ConoHa で512MBプランを使ってみる
ConoHaの新プラン512MBがでました!
祝ConoHa新プラン!ということで、さっそく512MBプランを試してみました。
ConoHaでKUSANAGIインスタンス作成
ConoHa のVPSを申し込んで、512MBプランを選択して、今まで通りKUSANAGIインスタンスを作成します。
詳しくは、 KUSANAGI for ConoHa を参照。
作成したVPSのIPは、ホスト名を付けてDNSに登録しておきます。
KUSANAGIで簡単WordPressインストール
SSHログインして、以下のコマンドを実行するとWordPressがインストールされます。DBの情報やパスワードは適宜変更してください。
yum update -y kusanagi init --tz tokyo --keyboard en --lang en --passwd passw0rd --nophrase --dbrootpass パスワード --nginx --hhvm kusanagi provision --wplang ja --fqdn test.myzkstr.tech --email s.miyaza@gmail.com --dbname テスト --dbuser テスト--dbname テスト --dbpass パスワード test01 sed -ne '/\/\*\*\#\@\-\*\//,$ p' /home/kusanagi/test01/DocumentRoot/wp-config-sample.php | wp core config --dbname=テスト --dbuser=テスト --dbpass=パスワード --dbhost=localhost --dbcharset=utf8mb4 --extra-php --path=/home/kusanagi/test01/DocumentRoot wp core install --url=http://test.myzkstr.tech --title=test --admin_user=test01 --admin_password=パスワード --admin_email=メールアドレス --path=/home/kusanagi/test01/DocumentRoot
ね、簡単でしょ?これで、NGINX+hhvmでhttp/2対応のWordPress環境が作成できました。
今回、wp コマンドとというCLIを使ったのですが、これを使うとWordPressの操作をコマンドラインから可能になり、CLIからWordPressの初期設定が可能になります。
ただ、WebUIからのインストールと違って、DocumentRoot/wp-config-sample.php からwp-config.php を生成してくれないので、–extra-php オプションとsed芸を駆使して差分を何とかしてあります。
これをしないとbcacheが動作しないことがわかっています。
http のベンチマークをとってみる
ということで早速abでベンチ。
インストール直後の状態で、だいたい80req/s ですね。
# ab -n 300 -c 50 http://test.myzkstr.tech/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
中略
Server Software: nginx
Server Hostname: test.myzkstr.tech
Server Port: 80
Document Path: /
Document Length: 10988 bytes
Concurrency Level: 50
Time taken for tests: 3.844 seconds
Complete requests: 300
Failed requests: 0
Total transferred: 3381300 bytes
HTML transferred: 3296400 bytes
Requests per second: 78.04 [#/sec] (mean)
Time per request: 640.706 [ms] (mean)
Time per request: 12.814 [ms] (mean, across all concurrent requests)
Transfer rate: 858.96 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.3 0 1
Processing: 33 591 134.2 639 653
Waiting: 33 591 134.2 639 653
Total: 34 591 133.9 639 654
後略
一方先日までの最小構成だった1GBプランで同じく試してみました。175 req/s とだいたい半分くらい。だいたい512MBプランの2.2倍ですね。
# ab -n 300 -c 50 http://www.myzkstr.tech/
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
中略
Server Software: nginx
Server Hostname: www.myzkstr.net
Server Port: 80
Document Path: /
Document Length: 11107 bytes
Concurrency Level: 50
Time taken for tests: 1.714 seconds
Complete requests: 300
Failed requests: 0
Total transferred: 3423300 bytes
HTML transferred: 3332100 bytes
Requests per second: 174.99 [#/sec] (mean)
Time per request: 285.734 [ms] (mean)
Time per request: 5.715 [ms] (mean, across all concurrent requests)
Transfer rate: 1949.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 1
Processing: 24 264 57.9 283 301
Waiting: 24 264 57.9 283 301
Total: 25 264 57.7 283 301
後略
http/2 のベンチマークをとってみる
せっかくhttp/2にしたので、http/2 のベンチも取りましょう。
kusanagi-nghttp2 には h2loadというhttp/2 のベンチマークソフトが入っているので、それで取ります。
512MBプランでは、79req/sと http/1.1(非SSL) に劣らない性能が出ましたね。
# /usr/local/bin/h2load -n 300 -c 50 https://test.myzkstr.tech/
starting benchmark...
spawning thread #0: 50 total client(s). 300 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES256-GCM-SHA384
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done
finished in 3.78s, 79.43 req/s, 872.55KB/s
requests: 300 total, 300 started, 300 done, 300 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 300 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 3374450 bytes total, 51900 bytes headers (space savings 22.77%), 3309300 bytes data
min max mean sd +/- sd
time for request: 41.83ms 623.98ms 563.75ms 126.32ms 88.67%
time for connect: 98.28ms 110.15ms 103.94ms 4.77ms 48.00%
time to 1st byte: 140.25ms 728.68ms 433.06ms 176.09ms 60.00%
req/s : 1.59 1.88 1.73 0.09 60.00%
1GBプランも168req/sとそれなりで、やはり512MBプランの2.2倍くらいの性能がでました。
# /usr/local/bin/h2load -n 300 -c 50 https://www.myzkstr.net/
starting benchmark...
spawning thread #0: 50 total client(s). 300 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES256-GCM-SHA384
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done
finished in 1.78s, 168.80 req/s, 1.85MB/s
requests: 300 total, 300 started, 300 done, 300 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 300 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 3456950 bytes total, 98700 bytes headers (space savings 20.53%), 3345000 bytes data
min max mean sd +/- sd
time for request: 33.45ms 307.52ms 263.59ms 58.37ms 88.67%
time for connect: 32.39ms 84.00ms 47.43ms 11.14ms 70.00%
time to 1st byte: 65.84ms 369.96ms 219.38ms 92.96ms 57.00%
req/s : 3.38 4.59 3.70 0.29 80.00%
最後に
1GBでも十分安かったですが、512MBプランでさらにお安く、また小規模サイトで使うには十分な性能が出るWordPress環境が構築できます。
ぜひお試しください(ダイマ)
