sysctl vm.overcommit_memory=1
echo never > /sys/kernel/mm/transparent_hugepage/enabled
/data/redis-6379/redis-4.0.14-centos7/redis-server redis.conf \
--logfile /data/redis-6379/redis-4.0.14-centos7/redis.log \
--pidfile /var/run/redis_6379.pid \
--daemonize yes \
--port 6379 \
--dir /data/redis-6379/redis-4.0.14-centos7/
kuberntes中的redis集群性能调优
现在做不到像那篇文章那样的调优,用的是默认配置。
条件 |
set tps |
get tps |
windows本地 |
37878.79 |
39062.50 |
k8s集群-本地(kube-master2) |
69930.07 |
71428.57 |
k8s集群-远程-跨主机 (kube-master2 -> hadoop2) |
45662.10 |
50761.42 |
k8s集群-远程-跨主机 (hadoop2 -> kube-master2) |
54347.82 |
56497.18 |
linux 物理机 本地 未优化内核参数 (hadoop3) |
66225.17 |
66225.17 |
linux 物理机 本地 优化内核参数后 (hadoop3) |
53475.93 |
63291.14 |
linux 物理机 远程 未优化内核参数 (hadoop2 -> hadoop3) |
59171.60 |
59880.24 |
linux 物理机 远程 优化内核参数后 (hadoop2 -> hadoop3) |
60606.06 |
62111.80 |
参考:redis压力测试工具-----redis-benchmark
C:\green\Redis-x64-4.0.2.2
λ redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.26 seconds
50 parallel clients
3 bytes payload
keep alive: 1
71.24% <= 1 milliseconds
97.90% <= 2 milliseconds
99.97% <= 3 milliseconds
100.00% <= 3 milliseconds
37878.79 requests per second
C:\green\Redis-x64-4.0.2.2
λ redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.26 seconds
50 parallel clients
3 bytes payload
keep alive: 1
84.28% <= 1 milliseconds
99.39% <= 2 milliseconds
99.98% <= 3 milliseconds
100.00% <= 3 milliseconds
39062.50 requests per second
/data # redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.14 seconds
50 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
69930.07 requests per second
/data # redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.14 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.95% <= 1 milliseconds
100.00% <= 1 milliseconds
71428.57 requests per second
/data # redis-benchmark -h redis2 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.22 seconds
50 parallel clients
3 bytes payload
keep alive: 1
96.73% <= 1 milliseconds
97.92% <= 2 milliseconds
98.40% <= 3 milliseconds
98.79% <= 4 milliseconds
99.71% <= 5 milliseconds
100.00% <= 5 milliseconds
45662.10 requests per second
/data # redis-benchmark -h redis2 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.20 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.26% <= 1 milliseconds
99.51% <= 3 milliseconds
99.64% <= 4 milliseconds
100.00% <= 4 milliseconds
50761.42 requests per second
shijianjs@SHINELONPC:/mnt/c/java/git/k8s-test/practice/redis$ kubectl exec -it redis2-96bf85bdc-gjnd8 sh
/data # redis-benchmark -h redis1 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.18 seconds
50 parallel clients
3 bytes payload
keep alive: 1
96.78% <= 1 milliseconds
99.73% <= 2 milliseconds
100.00% <= 2 milliseconds
54347.82 requests per second
/data # redis-benchmark -h redis1 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.18 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.03% <= 1 milliseconds
100.00% <= 1 milliseconds
56497.18 requests per second
[root@hadoop3 redis-4.0.14-centos7]# ./redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.15 seconds
50 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
66225.17 requests per second
[root@hadoop3 redis-4.0.14-centos7]# ./redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.15 seconds
50 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
66225.17 requests per second
[root@hadoop3 redis-4.0.14-centos7]# ./redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.19 seconds
50 parallel clients
3 bytes payload
keep alive: 1
95.98% <= 1 milliseconds
99.84% <= 2 milliseconds
100.00% <= 2 milliseconds
53475.93 requests per second
[root@hadoop3 redis-4.0.14-centos7]# ./redis-benchmark -h 127.0.0.1 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.16 seconds
50 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
63291.14 requests per second
/data # redis-benchmark -h 10.60.44.54 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.17 seconds
50 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
59171.60 requests per second
/data # redis-benchmark -h 10.60.44.54 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.17 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.52% <= 1 milliseconds
100.00% <= 1 milliseconds
59880.24 requests per second
/data # redis-benchmark -h 10.60.44.54 -p 6379 -c 50 -n 10000 -t set
====== SET ======
10000 requests completed in 0.17 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.92% <= 1 milliseconds
100.00% <= 1 milliseconds
60606.06 requests per second
/data # redis-benchmark -h 10.60.44.54 -p 6379 -c 50 -n 10000 -t get
====== GET ======
10000 requests completed in 0.16 seconds
50 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
62111.80 requests per second