Commit Graph

39 Commits

Author SHA1 Message Date
dejun.xdj
1ab64d405e Revise the comments of latency command. 2018-08-22 18:07:02 +08:00
WuYunlong
d6ba4fd56d Fix config set slowlog-log-slower-than and condition in createLatencyReport 2018-07-13 17:53:55 +08:00
Jack Drogon
93238575f7 Fix typo 2018-07-03 18:19:46 +02:00
charsyam
9d41436115 getting rid of duplicated code 2018-02-14 00:12:13 +09:00
Oran Agra
8e8d957ff8 fix to latency monitor reporting wrong max latency
in some cases LATENCY HISTORY reported latency that was
higher than the max latency reported by LATENCY LATEST / DOCTOR
2018-02-13 15:58:40 +02:00
antirez
adeed29a99 Use SipHash hash function to mitigate HashDos attempts.
This change attempts to switch to an hash function which mitigates
the effects of the HashDoS attack (denial of service attack trying
to force data structures to worst case behavior) while at the same time
providing Redis with an hash function that does not expect the input
data to be word aligned, a condition no longer true now that sds.c
strings have a varialbe length header.

Note that it is possible sometimes that even using an hash function
for which collisions cannot be generated without knowing the seed,
special implementation details or the exposure of the seed in an
indirect way (for example the ability to add elements to a Set and
check the return in which Redis returns them with SMEMBERS) may
make the attacker's life simpler in the process of trying to guess
the correct seed, however the next step would be to switch to a
log(N) data structure when too many items in a single bucket are
detected: this seems like an overkill in the case of Redis.

SPEED REGRESION TESTS:

In order to verify that switching from MurmurHash to SipHash had
no impact on speed, a set of benchmarks involving fast insertion
of 5 million of keys were performed.

The result shows Redis with SipHash in high pipelining conditions
to be about 4% slower compared to using the previous hash function.
However this could partially be related to the fact that the current
implementation does not attempt to hash whole words at a time but
reads single bytes, in order to have an output which is endian-netural
and at the same time working on systems where unaligned memory accesses
are a problem.

Further X86 specific optimizations should be tested, the function
may easily get at the same level of MurMurHash2 if a few optimizations
are performed.
2017-02-20 17:29:17 +01:00
antirez
945a2f948e zmalloc: zmalloc_get_smap_bytes_by_field() modified to work for any PID.
The goal is to get copy-on-write amount of the child from the parent.
2016-09-19 10:28:42 +02:00
antirez
32f80e2f1b RDMF: More consistent define names. 2015-07-27 14:37:58 +02:00
antirez
554bd0e7bd RDMF: use client instead of redisClient, like Disque. 2015-07-26 15:20:52 +02:00
antirez
cef054e868 RDMF (Redis/Disque merge friendlyness) refactoring WIP 1. 2015-07-26 15:17:18 +02:00
antirez
509a6cc1e8 Fix iterator for issue #2438.
Itereator misuse due to analyzeLatencyForEvent() accessing the
dictionary during the iteration, without the iterator being
reclared as safe.
2015-03-04 11:48:19 -08:00
antirez
585d1a60bf Separate latency monitoring of eviction loop and eviction DELs. 2015-02-11 10:52:27 +01:00
Salvatore Sanfilippo
4b03be6d2f Merge pull request #2197 from sunheehnus/sparkline
sparkline.c: mov label-ini into the AddSample Function
2014-12-09 11:27:40 +01:00
Sun He
c87a37661e sparkline.c: mov label-ini into the AddSample Function 2014-12-08 11:15:06 +08:00
antirez
620906693e Fix non-linux builds error introduced with THP checks. 2014-11-14 17:13:35 +01:00
antirez
7ea331d601 THP detection for LATENCY DOCTOR. 2014-11-12 11:17:12 +01:00
antirez
3ef0876b95 THP detection / reporting functions added. 2014-11-12 10:43:32 +01:00
antirez
edca2b14d2 Remove warnings and improve integer sign correctness. 2014-08-13 11:44:38 +02:00
antirez
6382936ebc Fix typo in LATENCY DOCTOR output. 2014-07-11 10:57:28 +02:00
antirez
0dcc754f68 LATENCY HISTORY returns empty array if no data is available.
Previously we returned an error.
2014-07-10 16:20:40 +02:00
antirez
067e365042 Fixed a few missing newline in createLatencyReport(). 2014-07-09 16:45:40 +02:00
antirez
fda2b30346 createLatencyReport(): compile before commit avoids commits. 2014-07-08 17:17:08 +02:00
antirez
924dc9731f createLatencyReport(), fix mount option name. 2014-07-08 17:12:21 +02:00
antirez
51e01c0450 createLatencyReport(): initialize all advices to zero. 2014-07-08 17:11:56 +02:00
antirez
7fb90a670e LATENCY DOCTOR first implementation complete. 2014-07-08 17:05:56 +02:00
antirez
57e931debc Fix analyzeLatencyForEvent() MAD computation. 2014-07-08 12:56:45 +02:00
antirez
2a232dfa9a LATENCY DOCTOR: initial draft and events summary output. 2014-07-08 11:31:46 +02:00
antirez
19853db892 Latency: low level time series analysis implemented. 2014-07-07 15:00:01 +02:00
antirez
b2604dc58c LATENCY SAMPLES renamed LATENCY HISTORY. 2014-07-07 12:35:24 +02:00
antirez
f8934657b2 LATENCY RESET implemented. 2014-07-07 12:34:54 +02:00
antirez
1f665d6e82 Cast void* to char* to avoid waring in latencyCommand(). 2014-07-02 16:56:08 +02:00
antirez
e3c0125b70 Properly initialize min/max in latency.c. 2014-07-02 16:55:34 +02:00
antirez
a53c734094 LATENCY GRAPH: filling under the curve is more readable. 2014-07-02 16:37:53 +02:00
antirez
aa16f87b87 LATENCY GRAPH implemented. 2014-07-02 16:31:22 +02:00
antirez
1766d91697 LATENCY LATEST: add the max field. 2014-07-02 12:40:38 +02:00
antirez
f35abe2ff5 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-01 17:12:09 +02:00
antirez
83beaa886c LATENCY LATEST implemented. 2014-07-01 16:17:33 +02:00
antirez
551bee86b4 LATENCY SAMPLES implemented. 2014-07-01 16:07:13 +02:00
antirez
d7a07a2012 Latency monitor: basic samples collection. 2014-07-01 11:30:15 +02:00