redis海量数据测试(续三)

redis海量数据测试(续三)

提纲:

  • redis海量数据测试( 续三)
    • 环境
    • 运行脚本
    • redis配置
    • 运行时间
    • 系统状态
    • 运行结果

100000000 keys in Redis 2.2.12

用1到100000000数字做key,用固定uuid做value,写入redis
key:value格式:

                  

100000000:0810d16b-056d-47f4-9895-48399b50b169

环境

CPU:Intel(R) Xeon(R) CPU E5620 @ 2.40GHz X 2
MEM:32G
DISK:300G SAS

运行脚本

run.sh

                  
#!/bin/sh
for i in `seq 1 100`
do
~/redis_test2.sh $i &
done


redis_test2.sh


                  
#!/bin/sh
log=~/redis_run.log
slog=~/redis_status.log
redis=/usr/local/redis/bin/redis-cli
#cat /dev/null > $log
#cat /dev/null > $slog
echo "$1 `date`" >> $log
j=1000000
s=$1
e=$[ $s * $j ]
((s--))
k=$[ $s * $j ]
while [ $k -le $e ]
do
v="c0a2ddd5-e077-41db-a74f-108d016b7f35"
$redis set $k $v
#echo "$k:$v" >> $log
((k++))
done
echo "$1 `date`" >> $log

由run.sh产生100个redis_test2.sh进程,每个redis_test2.sh顺序写1000000个key-value

redis配置

                  
daemonize yes
pidfile /var/run/redis.pid
port 6379
timeout 30
loglevel verbose
logfile /home/redis/logs/redis.log
databases 16
rdbcompression yes
dbfilename dump.rdb
dir /home/redis/rdbs
slave-serve-stale-data yes
maxmemory 30G
maxmemory-policy volatile-lru
appendonly yes
appendfsync everysec
no-appendfsync-on-rewrite no
slowlog-log-slower-than 10000
slowlog-max-len 1024
vm-enabled no
vm-swap-file /home/redis/redis.swap
vm-max-memory 30G
vm-page-size 32
vm-pages 134217728
vm-max-threads 16
hash-max-zipmap-entries 512
hash-max-zipmap-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
activerehashing yes

运行时间


Thu Oct 20 14:18:05 CST 2011

Thu Oct 20 17:55:12 CST 2011
约3小时30多分钟

系统状态

                  
top - 14:53:39 up 79 days, 19:28, 7 users, load average: 14.08, 14.42, 13.41
Tasks: 396 total, 7 running, 389 sleeping, 0 stopped, 0 zombie
Cpu0 : 21.2%us, 36.1%sy, 0.0%ni, 38.4%id, 0.0%wa, 0.0%hi, 4.3%si, 0.0%st
Cpu1 : 20.9%us, 36.8%sy, 0.0%ni, 38.1%id, 0.0%wa, 0.0%hi, 4.3%si, 0.0%st
Cpu2 : 22.3%us, 36.2%sy, 0.0%ni, 38.2%id, 0.0%wa, 0.0%hi, 3.3%si, 0.0%st
Cpu3 : 21.5%us, 36.8%sy, 0.0%ni, 38.4%id, 0.0%wa, 0.0%hi, 3.3%si, 0.0%st
Cpu4 : 20.7%us, 39.3%sy, 0.0%ni, 36.0%id, 0.0%wa, 0.0%hi, 4.0%si, 0.0%st
Cpu5 : 22.3%us, 38.5%sy, 0.0%ni, 34.9%id, 0.0%wa, 0.0%hi, 4.3%si, 0.0%st
Cpu6 : 22.6%us, 36.5%sy, 0.0%ni, 34.9%id, 0.0%wa, 0.0%hi, 6.0%si, 0.0%st
Cpu7 : 22.5%us, 35.1%sy, 0.0%ni, 36.8%id, 0.0%wa, 0.0%hi, 5.6%si, 0.0%st
Cpu8 : 22.6%us, 37.9%sy, 0.0%ni, 34.9%id, 0.0%wa, 0.0%hi, 4.7%si, 0.0%st
Cpu9 : 22.5%us, 37.1%sy, 0.0%ni, 36.8%id, 0.0%wa, 0.0%hi, 3.6%si, 0.0%st
Cpu10 : 22.3%us, 37.0%sy, 0.0%ni, 36.7%id, 0.0%wa, 0.0%hi, 4.0%si, 0.0%st
Cpu11 : 22.8%us, 37.1%sy, 0.0%ni, 35.8%id, 0.0%wa, 0.0%hi, 4.3%si, 0.0%st
Cpu12 : 22.3%us, 41.3%sy, 0.0%ni, 33.0%id, 0.0%wa, 0.0%hi, 3.3%si, 0.0%st
Cpu13 : 21.5%us, 38.7%sy, 0.0%ni, 34.8%id, 0.0%wa, 0.0%hi, 5.0%si, 0.0%st
Cpu14 : 21.8%us, 39.3%sy, 0.0%ni, 33.7%id, 0.0%wa, 0.0%hi, 5.3%si, 0.0%st
Cpu15 : 23.7%us, 39.0%sy, 0.0%ni, 30.0%id, 0.0%wa, 0.0%hi, 7.3%si, 0.0%st

运行结果

                  
redis_version:2.2.12
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
process_id:13070
uptime_in_seconds:19495
uptime_in_days:0
lru_clock:1887443
used_cpu_sys:4562.01
used_cpu_user:8761.76
used_cpu_sys_children:0.00
used_cpu_user_children:0.00
connected_clients:1
connected_slaves:0
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
used_memory:15394540744
used_memory_human:14.34G
used_memory_rss:20719177728
mem_fragmentation_ratio:1.35
use_tcmalloc:0
loading:0
aof_enabled:1
changes_since_last_save:102308625
bgsave_in_progress:0
last_save_time:1319089180
bgrewriteaof_in_progress:0
total_connections_received:102308881
total_commands_processed:102308880
expired_keys:0
evicted_keys:0
keyspace_hits:2308625
keyspace_misses:100000002
hash_max_zipmap_entries:512
hash_max_zipmap_value:64
pubsub_channels:0
pubsub_patterns:0
vm_enabled:0
role:master
db0:keys=100000001,expires=0
                                                       
appendonly.aof6.6G
内存占用14.34G
标签: Redis
评论: 1 | 引用: 0 | 阅读: 9385
  • 1 
123 [ 2012-07-18 14:52 ]
总结个结论撒
  • 1