115 Commits

Author SHA1 Message Date
Wang Yuan
6918ebc92a Implement redisAtomic to replace _Atomic C11 builtin (#7707)
Redis 6.0 introduces I/O threads, it is so cool and efficient, we use C11
_Atomic to establish inter-thread synchronization without mutex. But the
compiler that must supports C11 _Atomic can compile redis code, that brings a
lot of inconvenience since some common platforms can't support by default such
as CentOS7, so we want to implement redis atomic type to make it more portable.

We have implemented our atomic variable for redis that only has 'relaxed'
operations in src/atomicvar.h, so we implement some operations with
'sequentially-consistent', just like the default behavior of C11 _Atomic that
can establish inter-thread synchronization. And we replace all uses of C11
_Atomic with redis atomic variable.

Our implementation of redis atomic variable uses C11 _Atomic, __atomic or
__sync macros if available, it supports most common platforms, and we will
detect automatically which feature we use. In Makefile we use a dummy file to
detect if the compiler supports C11 _Atomic. Now for gcc, we can compile redis
code theoretically if your gcc version is not less than 4.1.2(starts to support
__sync_xxx operations). Otherwise, we remove use mutex fallback to implement
redis atomic variable for performance and test. You will get compiling errors
if your compiler doesn't support all features of above.

For cover redis atomic variable tests, we add other CI jobs that build redis on
CentOS6 and CentOS7 and workflow daily jobs that run the tests on them.
For them, we just install gcc by default in order to cover different compiler
versions, gcc is 4.4.7 by default installation on CentOS6 and 4.8.5 on CentOS7.

We restore the feature that we can test redis with Helgrind to find data race
errors. But you need install Valgrind in the default path configuration firstly
before running your tests, since we use macros in helgrind.h to tell Helgrind
inter-thread happens-before relationship explicitly for avoiding false positives.
Please open an issue on github if you find data race errors relate to this commit.

Unrelated:
- Fix redefinition of typedef 'RedisModuleUserChangedFunc'
  For some old version compilers, they will report errors or warnings, if we
  re-define function type.
2020-09-17 16:01:45 +03:00
filipe oliveira
2693e8f245 Extended redis-benchmark instant metrics and overall latency report (#7600)
A first step to enable a consistent full percentile analysis on query latency so that we can fully understand the performance and stability characteristics of the redis-server system we are measuring. It also improves the instantaneous reported metrics, and the csv output format.
2020-08-25 21:21:29 +03:00
michael-grunder
3db28bfe68 Use Hiredis' sdscompat.h to map sds* calls to hi_sds* 2020-08-15 13:13:23 -07:00
zhaozhao.zz
b1a242b84a redis-benchmark: fix wrong random key for hset (#4895) 2020-08-11 20:51:27 +08:00
ShooterIT
8925fac395 [Redis-benchmark] Remove zrem test, add zpopmin test 2020-08-08 23:08:27 +08:00
ShooterIT
e6c811cd85 [Redis-benchmark] Support zset type 2020-08-06 15:36:28 +08:00
马永泽
40e930dab5 fix benchmark in cluster mode fails to authenticate (#7488)
Co-authored-by: Oran Agra <oran@redislabs.com> (styling)
2020-07-10 16:37:11 +03:00
Salvatore Sanfilippo
83521eb832 Merge pull request #7196 from ShooterIT/benchmark
Redis Benchmark: make test data better
2020-05-19 16:16:38 +02:00
hwware
2b4f14387e Redis-Benchmark: avoid potentical memmory leaking 2020-05-18 22:10:57 -04:00
ShooterIT
16c95dce51 Redis Benchmark: generate random test data
The function of generating random data is designed by antirez. See #7196.
2020-05-18 18:18:27 +08:00
Salvatore Sanfilippo
d9f52aa871 Merge pull request #7204 from ShooterIT/benchmark-fix
Redis Benchmark: Fix coredump because of double free
2020-05-08 10:53:20 +02:00
ShooterIT
133df5a311 Redis Benchmark: Fix coredump because of double free 2020-05-05 23:09:45 +08:00
Benjamin Sergeant
8a3741342e Add --user argument to redis-benchmark.c (ACL) 2020-05-04 08:09:21 -07:00
antirez
023b67e80f Client side caching: redis-cli ability to enable tracking.
This is extremely useful in order to simulate an high load of requests
about different keys, and force Redis to track a lot of informations
about several clients, to simulate real world workloads.
2019-07-22 18:45:47 +02:00
artix
ec45f5b395 Redis Benchmark: prevent CONFIG failure from exiting program 2019-06-05 16:34:55 +02:00
Salvatore Sanfilippo
111ab16557 Merge pull request #6051 from vattezhang/unstable
fix: benchmark auth fails when server have requirepass
2019-05-02 09:48:02 +02:00
vattezhang
42bccb59c5 fix: benchmark auth fails when server have requirepass 2019-04-26 19:47:07 +08:00
vattezhang
03c7e580d7 update 2019-04-26 18:50:51 +08:00
vattezhang
dd038a522f Merge github.com:antirez/redis into unstable 2019-04-26 18:47:11 +08:00
git-hulk
7bda78088d FIX: core dump in redis-benchmark when the -r is the last arg 2019-04-24 20:05:35 +08:00
antirez
41fc29512c Fix assert comparison in fetchClusterSlotsConfiguration(). 2019-04-08 17:39:26 +02:00
vattezhang
4bfc1763c0 fix: fix benchmark cannot exit when NOAUTH err happens 2019-03-13 20:46:33 +08:00
vattezhang
48ce543a18 Merge branch 'unstable' of github.com:antirez/redis into unstable 2019-03-13 20:26:54 +08:00
artix
95b932ffcf Redis Benchmark: fix possible usage of freed pointer (getRedisConfig)
Fixes issue #5912
2019-03-12 17:07:23 +01:00
vattezhang
d3de74f795 Merge branch 'unstable' of github.com:antirez/redis into unstable 2019-03-12 21:52:20 +08:00
artix
14cce99469 Redis Benchmark: handle CLUSTERDOWN error 2019-03-08 11:05:02 +01:00
artix
634f65d4a0 Redis Benchmark: fix key randomization with zero keyspacelen 2019-03-07 11:30:09 +01:00
artix
ffe28e8be5 Redis Benchmark: add multithread idle mode
Fix issue #5891
2019-03-07 11:14:07 +01:00
artix
ead543dc90 Redis benchmark: update help with threads/cluster options 2019-03-01 18:15:44 +01:00
artix
de6718dbb1 Redis benchmark: fix default hset test key 2019-03-01 17:53:14 +01:00
artix
1b175234f6 Redis Benchmark: update slots configuration after MOVED/ASK reply 2019-03-01 17:53:14 +01:00
artix
7ef83aad5f Redis Benchmark: use atomic var for liveclients in 'createClient' 2019-03-01 17:53:14 +01:00
artix
f33bdf6b64 Redis Benchmark: display 'save' and 'appendonly' configuration 2019-03-01 17:53:14 +01:00
artix
f5ef17ef89 Redis benchmark: add {tag} to all default tests 2019-03-01 17:53:14 +01:00
artix
361a5a2892 Redis benchmark: fixed issued with config.hostip and code cleanup 2019-03-01 17:53:14 +01:00
artix
52ebd2ff18 Redis benchmark: configurable thread count in cluster mode and fixes 2019-03-01 17:53:14 +01:00
artix
c5ddfee4b4 Various changes to redis-benchmark thread and cluster support
- MOVED or ASK replies are now handled in cluster mode.
- Only the first slot per node is used in cluster mode.
- Mutlithreading: reduced usage of mutexes in favor of atomic vars.
2019-03-01 17:53:14 +01:00
artix
c8ca2b328e Redis benchmark: table-based slot hashtag placeholder replacement in cluster mode. 2019-03-01 17:53:14 +01:00
artix
bad4db5525 Added basic support for clusters to redis-benchmark. 2019-03-01 17:53:14 +01:00
artix
60b650be2a Thread support for redis-benchmark. 2019-03-01 17:53:14 +01:00
Madelyn Olson
8e20c1f854 Updated redis-benchmark so it doesn't show 1 value above 2ms at higher precision 2019-02-26 21:12:55 +00:00
vattezhang
efd66faa9c benchmark: add auth check in benchmark
When we run benchmark but forget to set the right requirepass, benchmark should return error.
2019-02-18 22:48:55 +08:00
antirez
78a2115c4c redis-benchmark: default precision=1, integer ms after 2 milliseconds.
Reltaed to discussion and PR #5840.
2019-02-14 13:19:51 +01:00
Madelyn Olson
5a1f8fd6f2 Rename variable 2019-02-13 21:03:31 +00:00
Madelyn Olson
b53eec3126 Updated redis benchmark with us precision support 2019-02-13 19:52:48 +00:00
zhaozhao.zz
0c608a4ce9 redis-benchmark: bugfix - handle zero liveclients in right way 2018-01-03 12:47:25 +08:00
Mota
76eab3512a redis-benchmark: default value size usage update.
default size of SET/GET value in usage should be 3 bytes as in main code.
2017-07-25 23:43:46 +08:00
Salvatore Sanfilippo
0f629c11fd Merge pull request #1998 from grobe0ba/unstable
Fix missing '-' in redis-benchmark help output (Issue #1996)
2017-07-24 15:18:08 +02:00
antirez
078cb38a81 redis-benchmark: add -t hset target. 2017-06-19 09:41:11 +02:00
hylepo
cc1a950227 Update redis-benchmark.c
Fixing typo in the usage of redis-benchmark
2016-11-11 10:33:48 +08:00