erlang mochiweb的测试数值

使用下面脚本压测:

siege -q -c1000 -r100 -lsiege.log -b http://127.0.0.1:8081/hello_world

然后mochiweb启动选项:

1使用选项:

{acceptor_pool_size, 200}

压测结果:

$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.使用选项:

{acceptor_pool_size, 20}

输出结果:

$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个数量级。

你可能感兴趣的:(erlang mochiweb的测试数值)