摘要:
统计redis数据同步时的网络性能,
硬件规格:
本机虚拟机进行
- cpu: 1核 2803.202MHz
- 网卡: 虚拟网卡
- 硬盘:
- 读取:
- 写入:
redis数据同步:
cluster集群 -> 另一台机器上的redis单点
redis单点只开启aof, 且关闭aof的rewrite重写, 只追加单个aof文件
port 6379
daemonize no
pidfile redis.pid
protected-mode no
cluster-enabled no
cluster-config-file nodes.conf
cluster-node-timeout 5000
save ""
appendonly yes
appendfsync everysec
replica-read-only yes
cluster-migration-barrier 1
logfile "redis.log"
loglevel notice
slowlog-log-slower-than 10000
slowlog-max-len 128
cluster-node-timeout 3000
repl-diskless-sync no
unixsocket ./redis.sock
auto-aof-rewrite-percentage 0
网络流量监控:
使用iftop, -s统计30s内的数据
#!/bin/bash
echo iftop -o 40s -t -B -N -n -P -t -L 50 -s 30 > ./iftop.log
iftop -o 40s -t -B -N -n -P -t -L 50 -s 30 > ./iftop.log
源cluster集群的机器流量:
Listening on ens33
# Host name (port/service if enabled) last 2s last 10s last 40s cumulative
--------------------------------------------------------------------------------------------
1 192.168.58.128:49780 => 520B 17.8MB 21.5MB 602MB
192.168.58.131:6379 <= 7.07KB 447KB 602KB 16.5MB
2 192.168.58.128:22 => 66B 560B 630B 17.2KB
192.168.58.1:53230 <= 69B 479B 535B 14.6KB
3 192.168.58.128:22 => 0B 188B 305B 8.34KB
192.168.58.1:64139 <= 0B 23B 67B 1.84KB
4 192.168.58.128:40602 => 0B 269B 96B 2.62KB
40.77.226.250:443 <= 0B 470B 168B 4.59KB
5 192.168.58.128:47295 => 0B 14B 5B 142B
192.168.58.2:53 <= 0B 32B 11B 318B
6 192.168.58.128:22 => 0B 4B 1B 40B
192.168.58.1:59989 <= 0B 9B 3B 92B
7 192.168.58.128:22 => 0B 0B 0B 0B
192.168.58.1:59953 <= 0B 0B 2B 46B
--------------------------------------------------------------------------------------------
Total send rate: 586B 17.8MB 21.5MB
Total receive rate: 7.14KB 448KB 603KB
Total send and receive rate: 7.71KB 18.3MB 22.1MB
--------------------------------------------------------------------------------------------
Peak rate (sent/received/total): 47.6MB 1.43MB 49.0MB
Cumulative (sent/received/total): 602MB 16.5MB 618MB
============================================================================================
目的redis单点的机器流量:
Listening on ens160
# Host name (port/service if enabled) last 2s last 10s last 40s cumulative
--------------------------------------------------------------------------------------------
1 192.168.58.131:6379 => 593KB 713KB 541KB 15.9MB
192.168.58.128:49780 <= 25.2MB 26.7MB 19.3MB 579MB
2 192.168.58.131:22 => 656B 510B 446B 13.1KB
192.168.58.1:54647 <= 92B 51B 44B 1.30KB
3 192.168.58.131:68 => 0B 0B 10B 304B
192.168.58.254:67 <= 0B 0B 11B 328B
4 192.168.58.131:22 => 0B 0B 6B 188B
192.168.58.1:59260 <= 0B 0B 2B 46B
5 192.168.58.131:22 => 0B 0B 1B 40B
192.168.58.1:57034 <= 0B 0B 3B 92B
6 192.168.58.131:22 => 0B 4B 1B 40B
192.168.58.1:57112 <= 0B 9B 3B 92B
--------------------------------------------------------------------------------------------
Total send rate: 594KB 713KB 542KB
Total receive rate: 25.2MB 26.7MB 19.3MB
Total send and receive rate: 25.8MB 27.4MB 19.8MB
--------------------------------------------------------------------------------------------
Peak rate (sent/received/total): 1.24MB 45.8MB 47.1MB
Cumulative (sent/received/total): 15.9MB 579MB 595MB
============================================================================================