developer's diary

最近はc#のエントリが多いです

M3 ダブルエクストララージインスタンス(m3.2xlarge)インスタンスでnode.jsのコンパイル

m3.2xlargeを試したくなり、一番安いバージニアのデータセンターを利用してみた。

f:id:mitsugi-bb:20130316234322p:plain

スペック

項目
メモリ 30 GiB
CPU 26 ECU(3.25 ECU × 8 仮想コア)

さっそくnode.jsのコンパイル。

予想ではコア数が増えてるだけなので、5分くらいかと思ってます。

rootで実行

sudo su -
yum -y install wget openssl-devel gcc-c++ make
wget http://nodejs.org/dist/v0.10.0/node-v0.10.0.tar.gz
time tar zxvf node-v0.10.0.tar.gz
cd node-v0.10.0
./configure
time make
make install

解凍時間

tar m1.xlarge m1.large m1.small t1.micro GMOクラウド VPS m3.2xlarge
real 0m0.851s 0m1.034s 0m3.999s 0m1.286s 0m1.553s 0m0.805s
user 0m0.680s 0m0.736s 0m1.712s 0m0.560s 0m0.737s 0m0.528s
sys 0m0.496s 0m0.504s 0m1.660s 0m0.420s 0m0.762s 0m0.464s

コンパイル時間

make m1.xlarge m1.large m1.small t1.micro GMOクラウド VPS m3.2xlarge
real 6m16.558s 6m14.260s 13m45.992s 39m51.288s 6m47.398s 4m30.627s
user 4m54.962s 4m52.074s 10m48.917s 29m23.018s 4m7.297s 3m27.629s
sys 0m46.923s 0m46.819s 2m15.564s 6m20.580s 0m37.334s 0m32.458s

思ったよりも速かったです。恐らくI/Oが良いのだと思います。

ab -c100 -n10000 をテスト

node.jsのHTTPサーバは https://gist.github.com/shigeki/4148268 を参考に。

Requests per second [#/sec] (mean)

- m1.xlarge m1.large m1.small t1.micro m3.2xlarge
1k 2949.32 1948.28 962.10 2521.37 3230.20
10k 1642.44 1652.94 119.313 1736.27 3443.22
100k - - - - 2531.25
1m - - - - 628.37
10m - - - - 69.76
100m - - - - 7.60 ( ab -c100 -n1000 )

ab -c100 -n1000 をテスト Requests per second [#/sec] (mean)

m3.2xlarge httpd nginx node.js
100m 13.00 13.76 7.92

ab -c100 -n1000 をテスト Requests per second [#/sec] (mean)

m3.2xlarge httpd nginx node.js
100m 13.00 13.76 7.92

ab -c1000 -n10000 をテスト Requests per second [#/sec] (mean)

m3.2xlarge httpd nginx node.js
1k 9645.21 13566.18 落ちる
10k 9686.05 12876.19 落ちる
100k 落ちる(Total of 9357 requests completed) 5377.25 落ちる
1M 落ちる(Total of 9593 requests completed) 1065.10 落ちる
10M 落ちる(Total of 1147 requests completed) 落ちる(ests Total of 1515 requests completed) 落ちる

nginxいいね。