EC2 m1.small でnginxでどれくらいのリクエスト数さばけるの?

あれれ、、、?
同じシリーズでsmallで試したらレスポンスのスピードが速いんですけど、
違いは、、、、?もしかしたら、AZがap-northeast-1aだからなの?
前の2つの記事のものは、AZがap-northeast-1cでした。
また今度調べます。

にしても秒間リクエストは4222と下がりました。

./wrk -t 4 -c 10 -d 10 http://localhost/index.html
Running 10s test @ http://localhost/index.html
4 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 420.45ms 280.48ms 640.44ms 69.47%
Req/Sec 1.91k 3.54k 9.78k 79.55%
42268 requests in 10.01s, 13.62MB read
Requests/sec: 4222.73
Transfer/sec: 1.36MB

EC2 m1.large でnginxでどれくらいのリクエスト数さばけるの?

m1.largeのスペックは

メモリ:7.5 GiB
コンピューティングユニット:4
仮想コア数:2
コアの種類:各 2 ECU
ネットワークパフォーマンス:モデレート

OSは以下です。

more /etc/system-release
Amazon Linux AMI release 2013.09

ベンチマークツールはこちら wg/wrk を利用しました。

https://github.com/wg/wrk
wg/wrkをmakeするには、openssl-develとgccが必要です。

nginxのインストールはyumでやりました。

yum yum するのは、以下で終わりです。
yum install nginx git gcc openssl-devel

結果は以下です。

コマンドは、
./wrk -t スレッド数 -c 接続数 -d 処理時間 URL
です。

./wrk -t12 -c400 -d30s http://localhost/pass.html
Running 30s test @ http://localhost/pass.html
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 21.14s 11.29s 29.99s 77.85%
Req/Sec 5.28k 4.02k 9.00k 63.45%
470558 requests in 30.02s, 146.74MB read
Socket errors: connect 0, read 0, write 0, timeout 5417
Requests/sec: 15676.21
Transfer/sec: 4.89MB

タイムアウトもあるし平均20秒かかるってのもどうかと思うので。
なんとなく減らしてみました。

./wrk -t 4 -c 10 -d 10 http://localhost/index.html
Running 10s test @ http://localhost/index.html
4 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 483.22us 281.37us 7.80ms 69.14%
Req/Sec 4.50k 1.15k 7.55k 54.73%
169518 requests in 9.98s, 52.86MB read
Requests/sec: 16977.78
Transfer/sec: 5.29MB

maxが7.8ミリ秒、平均483.22マイクロ秒
169518 リクエスト大成功?タイムアウトもなし。

何これすげー速いな。

こちらのサイトを参考にさせていただきました。

「G-WANはなぜ速いのか?をnginxと比べながら検証してみた」blog.nomadscafe.jp | http://blog.nomadscafe.jp/2013/09/benchmark-g-wan-and-nginx.html

設定ファイルはコレ。です。


user nginx;
worker_processes 2;
worker_cpu_affinity 01 10;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
accept_mutex_delay 100ms;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr – $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
keepalive_requests 31250;
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
open_file_cache max=10000;
}
error_page 404 /404.html;
location = /40x.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

view raw

nginx.conf

hosted with ❤ by GitHub