使用下面腳本壓測:html
siege -q -c1000 -r100 -lsiege.log -b http://127.0.0.1:8081/hello_world
而後mochiweb啓動選項:web
1使用選項:shell
{acceptor_pool_size, 200}
壓測結果:code
$siege -q -c1000 -r100 -lsiege.log -b http://127.0.0.1:8081/hello_world Transactions: 100000 hits Availability: 100.00 % Elapsed time: 6.69 secs Data transferred: 1.24 MB Response time: 0.04 secs Transaction rate: 14947.68 trans/sec Throughput: 0.19 MB/sec Concurrency: 565.82 Successful transactions: 100000 Failed transactions: 0 Longest transaction: 3.31 Shortest transaction: 0.00
2.使用選項:xml
{acceptor_pool_size, 20}
輸出結果:htm
$siege -q -c1000 -r100 -lsiege.log -b http://127.0.0.1:8081/hello_world Transactions: 100000 hits Availability: 100.00 % Elapsed time: 7.36 secs Data transferred: 1.24 MB Response time: 0.03 secs Transaction rate: 13586.96 trans/sec Throughput: 0.17 MB/sec Concurrency: 473.18 Successful transactions: 100000 Failed transactions: 0 Longest transaction: 7.04 Shortest transaction: 0.00
能夠看到次數相同,但響應時間是20個鏈接池的較快,但其餘數值是200個鏈接池的較好。顯然,20 - 200間個某個特殊值可能會達到最優,由於這裏面的差距沒有1個數量級。it