Commit Graph

4172 Commits

Author SHA1 Message Date
2e581217d9 Fix analyzeLatencyForEvent() MAD computation. 2014-07-09 20:01:41 +02:00
121a9a3579 LATENCY DOCTOR: initial draft and events summary output. 2014-07-09 20:01:37 +02:00
3dd113bf33 Latency: low level time series analysis implemented. 2014-07-09 20:01:33 +02:00
3e8f5113fa LATENCY SAMPLES renamed LATENCY HISTORY. 2014-07-09 20:01:30 +02:00
c145854bac LATENCY RESET implemented. 2014-07-09 20:01:27 +02:00
65dbb3546a redis-benchmark: abort when all clients are disconnected. 2014-07-09 20:01:18 +02:00
4c68319370 Use fsync instead of aof_fsync in final AOF sync.
This happens in the child process so we don't care about latency:
better to sync metadata as well.
2014-07-09 20:01:01 +02:00
f3eab7a9b4 Fixed conditional for aof-write-pending-fsync latency event selection. 2014-07-09 20:00:57 +02:00
f3c4111edd Dependencies updated. 2014-07-09 20:00:50 +02:00
07b4d33734 Cast void* to char* to avoid waring in latencyCommand(). 2014-07-09 19:58:06 +02:00
58fb90fdac Properly initialize min/max in latency.c. 2014-07-09 19:57:59 +02:00
c005315a64 latencyStartMonitor() modified to avoid warnings. 2014-07-09 19:57:53 +02:00
e81b51ad8c Latency monitor: specialize delayed aof writes events. 2014-07-09 19:57:48 +02:00
8cc912db43 LATENCY GRAPH: filling under the curve is more readable. 2014-07-09 19:57:42 +02:00
e905588062 LATENCY GRAPH implemented. 2014-07-09 19:57:37 +02:00
b38996aab1 latencyTimeSeries structure max field type fixed. 2014-07-09 19:57:34 +02:00
062564c261 Free labels in freeSparklineSequence(). 2014-07-09 19:57:28 +02:00
d20d89e630 LATENCY LATEST: add the max field. 2014-07-09 19:57:22 +02:00
dc1c91a8bf Latency monitor trheshold value is now configurable.
This commit adds both support for redis.conf and CONFIG SET/GET.
2014-07-09 19:57:17 +02:00
350792bd72 ASCII sparklines generation API. 2014-07-09 19:57:08 +02:00
ed95915d33 License added to latency.h. 2014-07-09 19:56:47 +02:00
34afc91030 Latency monitor turned off by default.
It is not a good idea to bloat the code with gettimeofday() calls if the
instance is working well, and turning monitoring on at runtime is a
joke.
2014-07-09 19:56:43 +02:00
35a62f7408 Latency monitor: more hooks around the code. 2014-07-09 19:56:43 +02:00
855c97ce1b Latency monitor: don't add new samples in the same second.
Instead we update the old sample with the new latency if it is greater.
2014-07-09 19:56:35 +02:00
3cb03b68a4 LATENCY LATEST implemented. 2014-07-09 19:56:30 +02:00
e400ae60f5 Latency monitor: command duration is in useconds. Convert. 2014-07-09 19:04:02 +02:00
a57eb3272d LATENCY SAMPLES implemented. 2014-07-09 19:03:59 +02:00
72c84acc99 Latency monitor: collect slow commands.
We introduce the distinction between slow and fast commands since those
are two different sources of latency. An O(1) or O(log N) command without
side effects (can't trigger deletion of large objects as a side effect of
its execution) if delayed is a symptom of inherent latency of the system.

A non-fast command (commands that may run large O(N) computations) if
delayed may just mean that the user is executing slow operations.

The advices LATENCY should provide in this two different cases are
different, so we log the two classes of commands in a separated way.
2014-07-09 19:03:26 +02:00
58ecc0bd68 Latency monitor: basic samples collection. 2014-07-09 18:57:57 +02:00
0baab66d16 Fixed 2.8 build breakage introduced back porting COMMAND. 2014-07-02 22:42:00 +02:00
670cf9598e Fix Solaris compilation due to ctime_r() call.
Introduced in Redis 2.8.10 because of a change in Sentinel.
This closes issue #1837.
2014-06-30 16:29:14 +02:00
41d7c90417 Test: fix instances.tcl restart_instance abort error. 2014-06-30 12:06:24 +02:00
63feb93a9f COMMAND COUNT subcommand added. 2014-06-27 18:38:08 +02:00
0a6649a7c0 COMMAND: fix argument parsing.
This fixes detection of wrong subcommand (that resulted in the default
all-commands output instead) and allows COMMAND INFO to be called
without arguments (resulting into an empty array) which is useful in
programmtically generated calls like the following (in Ruby):

    redis.commands("command","info",*mycommands)

Note: mycommands may be empty.
2014-06-27 18:38:08 +02:00
53377f8c6d COMMANDS command renamed COMMAND. 2014-06-27 18:38:03 +02:00
f3efd529df COMMANDS command: remove static + aesthetic changes.
Static was removed since it is needed in order to get symbols in stack
traces. Minor changes in the source code were operated to make it more
similar to the existing Redis code base.
2014-06-27 18:37:34 +02:00
fdc5dbd5b1 Cluster: Add COMMANDS command
COMMANDS returns a nested multibulk reply for each
command in the command table.  The reply for each
command contains:
  - command name
  - arity
  - array of command flags
  - start key position
  - end key position
  - key offset step
  - optional: if the keys are not deterministic and
    Redis uses an internal key evaluation function,
    the 6th field appears and is defined as a status
    reply of: REQUIRES ARGUMENT PARSING

Cluster clients need to know where the keys are in each
command to implement proper routing to cluster nodes.

Redis commands can have multiple keys, keys at offset steps, or other
issues where you can't always assume the first element after
the command name is the cluster routing key.

Using the information exposed by COMMANDS, client implementations
can have live, accurate key extraction details for all commands.

Also implements COMMANDS INFO [commands...] to return only a
specific set of commands instead of all 160+ commands live in Redis.
2014-06-27 18:37:29 +02:00
afe949efcb Remove infinite loop from PSYNC test.
Added for debugging and forgot there.
2014-06-27 18:36:59 +02:00
1066fed769 Test: hopefully more robust PSYNC test.
This is supposed to fix issue #1417, but we'll know if this is enough
only after a couple of runs of the CI test without false positives.
2014-06-27 18:36:59 +02:00
cd4f0dc775 Allow __powerpc__ to define HAVE_ATOMIC too
From mailing list post https://groups.google.com/forum/#!topic/redis-db/D3k7KmJmYgM

In the file “config.h”, the definition HAVE_ATOMIC is used to indicate
if an architecture on which redis is implemented supports atomic
synchronization primitives.  Powerpc  supports atomic synchronization
primitives, however, it is not listed as one of the architectures
supported in config.h. This patch  adds the __powerpc__ to the list of
architectures supporting these primitives. The improvement of redis
due to the atomic synchronization on powerpc is significant,
around 30% to 40%, over the default implementation using pthreads.

This proposal adds __powerpc__ to the list of architectures designated
to support atomic builtins.
2014-06-27 18:36:59 +02:00
58fea46976 Allow atomic memory count update with C11 builtins
From mailing list post https://groups.google.com/forum/#!topic/redis-db/QLjiQe4D7LA

In zmalloc.c the following primitives are currently used
to synchronize access to single global variable:
__sync_add_and_fetch
__sync_sub_and_fetch

In some architectures such as powerpc these primitives are overhead
intensive. More efficient C11 __atomic builtins are available with
newer GCC versions, see
http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/_005f_005fatomic-Builtins.html#_005f_005fatomic-Builtins

By substituting the following  __atomic… builtins:
__atomic_add_fetch
__atomic_sub_fetch

the performance improvement on certain architectures such as powerpc can be significant,
around 10% to 15%, over the implementation using __sync builtins while there is only slight uptick on
Intel architectures because it was already enforcing Intel Strongly ordered memory semantics.

The selection of __atomic built-ins can be predicated on the definition of ATOMIC_RELAXED
which Is available on in gcc 4.8.2 and later versions.
2014-06-27 18:36:59 +02:00
ff3ca17bac Use predefined macro for used_memory() update 2014-06-27 18:36:59 +02:00
04749ee015 Fixed assert conditional in ROLE command test. 2014-06-26 22:13:57 +02:00
60ff8095d6 No more trailing spaces in Redis source code. 2014-06-26 18:52:16 +02:00
e9cd75dcd1 CLIENT KILL: don't kill the master as a normal client.
Technically the problem is due to the client type API that does not
return a special value for the master, however fixing it locally in the
CLIENT KILL command is better currently because otherwise we would
introduce a new output buffer limit class as a side effect.
2014-06-26 18:43:42 +02:00
ac6b656fd6 Old form of CLIENT KILL should still allow suicide. 2014-06-24 12:49:18 +02:00
32ebb3e651 Redis 2.8.12. 2.8.12 2014-06-23 16:56:18 +02:00
5d16a838db Sentinel test: more correct sentinels config reset.
In the initialization test for each instance we used to unregister the
old master and register it again to clear the config.
However there is a race condition doing this: as soon as we unregister
and re-register "mymaster", another Sentinel can update the new
configuration with the old state because of gossip "hello" messages.

So the correct procedure is instead, unregister "mymaster" from all the
sentinel instances, and re-register it everywhere again.
2014-06-23 14:04:09 +02:00
d3c2918434 Sentinel implementation of ROLE. 2014-06-23 12:07:55 +02:00
95f492ee57 Silence different signs comparison warning in sds.c. 2014-06-23 11:53:50 +02:00