測試案例如下列表所示,由此可以看出
1、SSD硬碟可以提升寫入大概20%的效能
2、1K以內的訊息,SATA硬碟一秒大概可以寫入6000
3、1K以內的訊息,SSD大概能寫入7800
4、batch、filesize、甚至同步非同步對其寫入影響都不大。
有時間再測試下更大訊息和更多情境,再結合現象和源碼分析一下。
128位元組的訊息
-------------------------------------------------
SATA,file:32M,batch預設是4M
send 1000000 messages with 128 bytes in 166.55 s
SATA,file:32M,batch:10w
send 1000000 messages with 128 bytes in 159.544 s
SATA,file:32M,batch:1000
send 1000000 messages with 128 bytes in 158.19 s
SATA,file:32M,batch:100
send 1000000 messages with 128 bytes in 156.697 s
SATA,file:32M,batch:1000
send 1000000 messages with 128 bytes in 148.788 s
SATA,file:32M,batch:6000
send 1000000 messages with 128 bytes in 153.437 s
SATA,sync:false,batch:6000
send 1000000 messages with 128 bytes in 138.062 s
SATA,sync:false,batch:10000,indexCacheSize="1000"
send 1000000 messages with 128 bytes in 142.276 s
SSD,file:32M,batch:100
send 1000000 messages with 128 bytes in 126.175 s
SSD,file:32M,batch:1000
send 1000000 messages with 128 bytes in 124.645 s
SSD,file:32M,batch:6000
send 1000000 messages with 128 bytes in 125.037 s
1024位元組的訊息
---------------------------------------------------
SATA,file:32M,batch:100
send 1000000 messages with 1024 bytes in 167.411 s
SATA,file:32M,batch:500
send 1000000 messages with 1024 bytes in 155.16 s
SATA,file:32M,batch:1000,預設配置
send 1000000 messages with 1024 bytes in 170.095 s
SATA,file:256M,batch:6000
send 1000000 messages with 1024 bytes in 185.918 s
SSD,file:32M,batch:100
send 1000000 messages with 1024 bytes in 128.828 s
SSD,file:32M,batch:500
send 1000000 messages with 1024 bytes in 128.957 s
SSD,file:32M,batch:1000,預設配置
send 1000000 messages with 1024 bytes in 129.577 s
SSD,file:256M,batch:6000
send 1000000 messages with 1024 bytes in 142.154 s