redis自帶一個(gè)很好的基準(zhǔn)測試工具,記錄一下測試效果,歡迎拍磚。我發(fā)現(xiàn)一個(gè)奇怪的情況,一些關(guān)于開源工具的博客,很少描述當(dāng)時(shí)主機(jī)的一些情況,沒有主機(jī)部分?jǐn)?shù)據(jù)的記錄,是有些不太完整的。
創(chuàng)新互聯(lián)公司作為成都網(wǎng)站建設(shè)公司,專注網(wǎng)站建設(shè)公司、網(wǎng)站設(shè)計(jì),有關(guān)成都定制網(wǎng)站方案、改版、費(fèi)用等問題,行業(yè)涉及VR全景等多個(gè)領(lǐng)域,已為上千家企業(yè)服務(wù),得到了客戶的尊重與認(rèn)可。環(huán)境介紹
1.redis服務(wù)器(虛擬機(jī),IP:192.168.163.156)
1M內(nèi)存
20G硬盤
Linux操作系統(tǒng)
2.redis 客戶端(虛擬機(jī),IP:192.168.163.146)
1M內(nèi)存
20G硬盤
3.監(jiān)控 zabbix (虛擬機(jī),IP:192.168.163.146)
1M內(nèi)存
20G硬盤
測試了2次
測試記錄
1.請求兩1w,并發(fā)數(shù)為4
# /usr/local/redis/bin/redis-benchmark -h 192.168.163.156 -p 6379 -c 4 -n 10000 ====== PING_INLINE ====== 10000 requests completed in 0.46 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.77% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 2 milliseconds 21598.27 requests per second ====== PING_BULK ====== 10000 requests completed in 0.42 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23696.68 requests per second ====== SET ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23364.49 requests per second ====== GET ====== 10000 requests completed in 0.44 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.95% <= 1 milliseconds 100.00% <= 1 milliseconds 22935.78 requests per second ====== INCR ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23201.86 requests per second ====== LPUSH ====== 10000 requests completed in 0.42 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23923.45 requests per second ====== RPUSH ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23148.15 requests per second ====== LPOP ====== 10000 requests completed in 0.44 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 22883.29 requests per second ====== RPOP ====== 10000 requests completed in 0.44 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 22883.29 requests per second ====== SADD ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.97% <= 1 milliseconds 100.00% <= 1 milliseconds 23148.15 requests per second ====== SPOP ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23474.18 requests per second ====== LPUSH (needed to benchmark LRANGE) ====== 10000 requests completed in 0.42 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23640.66 requests per second ====== LRANGE_100 (first 100 elements) ====== 10000 requests completed in 0.60 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.85% <= 2 milliseconds 99.91% <= 3 milliseconds 100.00% <= 3 milliseconds 16666.67 requests per second ====== LRANGE_300 (first 300 elements) ====== 10000 requests completed in 1.07 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 9337.07 requests per second ====== LRANGE_500 (first 450 elements) ====== 10000 requests completed in 1.27 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.88% <= 1 milliseconds 99.97% <= 2 milliseconds 100.00% <= 2 milliseconds 7849.29 requests per second ====== LRANGE_600 (first 600 elements) ====== 10000 requests completed in 1.64 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.72% <= 1 milliseconds 100.00% <= 1 milliseconds 6101.28 requests per second ====== MSET (10 keys) ====== 10000 requests completed in 0.46 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 21978.02 requests per second
LRANGE_600 (first 600 elements) 性能最差,6101.28 requests per second
2.請求兩10w,并發(fā)數(shù)為4
[root@hadoop1 zabbix]# /usr/local/redis/bin/redis-benchmark -h 192.168.163.156 -p 6379 -c 4 -n 100000 ====== PING_INLINE ====== 100000 requests completed in 4.40 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.94% <= 1 milliseconds 99.98% <= 2 milliseconds 99.99% <= 3 milliseconds 100.00% <= 3 milliseconds 22742.78 requests per second ====== PING_BULK ====== 100000 requests completed in 4.29 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 100.00% <= 1 milliseconds 23288.31 requests per second ====== SET ====== 100000 requests completed in 4.38 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 22857.14 requests per second ====== GET ====== 100000 requests completed in 4.41 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 22665.46 requests per second ====== INCR ====== 100000 requests completed in 4.67 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.95% <= 1 milliseconds 99.98% <= 2 milliseconds 99.99% <= 3 milliseconds 100.00% <= 3 milliseconds 21422.45 requests per second ====== LPUSH ====== 100000 requests completed in 4.30 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 23239.60 requests per second ====== RPUSH ====== 100000 requests completed in 4.33 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 4 milliseconds 100.00% <= 4 milliseconds 23105.36 requests per second ====== LPOP ====== 100000 requests completed in 4.35 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 2 milliseconds 100.00% <= 6 milliseconds 100.00% <= 6 milliseconds 22993.79 requests per second ====== RPOP ====== 100000 requests completed in 4.38 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 1 milliseconds 22836.26 requests per second ====== SADD ====== 100000 requests completed in 4.45 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 2 milliseconds 22461.81 requests per second ====== SPOP ====== 100000 requests completed in 4.39 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 100.00% <= 1 milliseconds 22773.86 requests per second ====== LPUSH (needed to benchmark LRANGE) ====== 100000 requests completed in 4.53 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 2 milliseconds 22094.56 requests per second ====== LRANGE_100 (first 100 elements) ====== 100000 requests completed in 5.63 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.98% <= 1 milliseconds 99.99% <= 2 milliseconds 99.99% <= 3 milliseconds 100.00% <= 3 milliseconds 17761.99 requests per second ====== LRANGE_300 (first 300 elements) ====== 100000 requests completed in 11.27 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.48% <= 1 milliseconds 99.69% <= 2 milliseconds 99.87% <= 3 milliseconds 99.98% <= 4 milliseconds 100.00% <= 5 milliseconds 100.00% <= 6 milliseconds 100.00% <= 6 milliseconds 8876.26 requests per second ====== LRANGE_500 (first 450 elements) ====== 100000 requests completed in 13.19 seconds 4 parallel clients 3 bytes payload keep alive: 1 98.89% <= 1 milliseconds 99.44% <= 2 milliseconds 99.66% <= 3 milliseconds 99.90% <= 4 milliseconds 99.97% <= 5 milliseconds 100.00% <= 7 milliseconds 100.00% <= 7 milliseconds 7583.23 requests per second ====== LRANGE_600 (first 600 elements) ====== 100000 requests completed in 17.35 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.67% <= 1 milliseconds 99.97% <= 2 milliseconds 99.98% <= 3 milliseconds 100.00% <= 4 milliseconds 5764.69 requests per second ====== MSET (10 keys) ====== 100000 requests completed in 4.56 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 21939.45 requests per second
最差的是LRANGE_600 ,5764.69 requests per second
主機(jī)監(jiān)控
另外,CPU load和Memory usage基本上沒什么變化。
結(jié)論:
redis set,get等類操作,能到到2w吞吐量。
不同的操作類型,對CPU的影響也不同。
奇怪,redis對內(nèi)存需求較穩(wěn)定。
創(chuàng)新互聯(lián)www.cdcxhl.cn,專業(yè)提供香港、美國云服務(wù)器,動(dòng)態(tài)BGP最優(yōu)骨干路由自動(dòng)選擇,持續(xù)穩(wěn)定高效的網(wǎng)絡(luò)助力業(yè)務(wù)部署。公司持有工信部辦法的idc、isp許可證, 機(jī)房獨(dú)有T級流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確進(jìn)行流量調(diào)度,確保服務(wù)器高可用性。佳節(jié)活動(dòng)現(xiàn)已開啟,新人活動(dòng)云服務(wù)器買多久送多久。
名稱欄目:redis演練(4)redis基準(zhǔn)測試-創(chuàng)新互聯(lián)
網(wǎng)頁地址:http://m.rwnh.cn/article48/dggehp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)、電子商務(wù)、網(wǎng)頁設(shè)計(jì)公司、動(dòng)態(tài)網(wǎng)站、企業(yè)網(wǎng)站制作、關(guān)鍵詞優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容