結論
QCon 2012 で Warp+Yesod がいいと言っていたので、ベンチをとってみました。いいっぽいです
サーバーサイドのチューニングはデフォなので、スレッド数位は合わせてベンチマークをとりたいと思って下ります。 なんかサーセン
環境
Server
Ubuntu 11.10
Intel(R) Xeon(R) CPU 5160 @ 3.00GHz x 2
Memory 2 GiB
|
|
Client
Mac OS X 10.7.3
2.53 GHz Intel Core i5
Memory 8 GB 1067 MHz DDR3
計測の仕方
$ ab -n request_count -c 128 -r -g gnuplot_file_name http://ubuntu.server:port/path >& result.txt
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
計測したもの
| Apache |
Lighttpd |
Server Software: Apache/2.2.20
Server Hostname: xxx.xxx.xxx.xxx
Server Port: 80
Document Path: /index.html
Document Length: 85 bytes
|
Server Software: lighttpd/1.4.30
Server Hostname: xxx.xxx.xxx.xxx
Server Port: 8123
Document Path: /index.html
Document Length: 85 bytes
|
| Node.js |
Warp + Yesod |
|
version: 0.6.15
Server Software:
Server Hostname: xxx.xxx.xxx.xxx
Server Port: 8124
Document Path: /
Document Length: 80 bytes
|
ghc: 7.0.3
warp: 1.2.0.1
yesod: 1.0.0.2
Server Software: Warp/1.2.0.1
Server Hostname: xxx.xxx.x.160
Server Port: 8123
Document Path: /index
Document Length: 99 bytes
|
| Tomcat |
Jetty |
Server Software: Apache-Coyote/1.1
Server Hostname: xxx.xxx.xxx.xxx
Server Port: 8080
Document Path: /sample/index.html
Document Length: 85 bytes
|
Server Software: Jetty(8.1.2.v20120308)
Server Hostname: xxx.xxx.xxx.xxx
Server Port: 8080
Document Path: /sample/index.html
Document Length: 85 bytes
|
計測結果
wait time 分布図
30000 request
10000 request
wait time について => Between writing request and reading response
Source らしい(何となく怪しい) から一部抜粋
struct data {
#ifdef USE_SSL
/* XXX insert timings for ssl */
#endif
int read; /* number of bytes read */
long starttime; /* start time of connection in seconds since
* Jan. 1, 1970 */
long waittime; /* Between writing request and reading response */
long ctime; /* time in ms to connect */
long time; /* time in ms for connection */
};
テスト時間 (sec)
apache, lighttpd はリクエスト数が多いとテストに時間がかかります。
result/apache-time.dat
request 1 2 3 4
200 0.028 0.035 0.030 0.031
500 0.081 0.087 0.078 0.069
1500 0.187 0.172 0.187 0.185
10000 90.143 109.438 107.131 104.303
30000 18.995 3.584 32.986 327.660
result/lighttpd-time.dat
request 1 2 3 4
200 0.025 0.025 0.027 0.026
500 0.063 0.069 0.055 0.053
1500 2.139 0.561 0.168 0.169
10000 50.097 52.646 2.285 34.739
30000 142.147 5.152 165.114 162.209
result/nodejs-time.dat
request 1 2 3 4
200 0.034 0.039 0.034 0.032
500 0.097 0.074 0.073 0.072
1500 0.238 0.235 0.245 0.211
10000 1.560 1.610 5.101 1.505
30000 8.593 24.368 16.838 31.659
result/warp-time.dat
request 1 2 3 4
200 0.071 0.093 0.074 0.070
500 0.160 0.309 0.229 0.176
1500 1.264 1.057 1.326 1.048
10000 3.115 10.991 11.347 5.078
30000 33.264 34.866 33.098 34.690
result/tomcat-time.dat
request 1 2 3 4
200 0.021 0.024 0.025 0.080
500 0.052 0.050 0.049 0.043
1500 0.151 0.167 0.166 0.153
10000 9.062 10.112 6.957 0.965
30000 21.004 12.324 21.602 18.784
result/jetty-time.dat
request 1 2 3 4
200 0.025 0.025 0.026 0.028
500 0.087 0.104 14.926 0.059
1500 1.127 22.815 1.244 14.990
10000 11.779 11.658 11.648 11.617
30000 36.141 36.806 36.773 36.225