Skip to content

Instantly share code, notes, and snippets.

@ma2gedev
Last active September 12, 2015 00:45
Show Gist options
  • Select an option

  • Save ma2gedev/00e079836d2a7379b81f to your computer and use it in GitHub Desktop.

Select an option

Save ma2gedev/00e079836d2a7379b81f to your computer and use it in GitHub Desktop.
isucon4 qual phoenix のアプリ外設定変更による結果推移
全部ローカルの MacBook Air で計測
## デフォルト
```
$ ./benchmarker bench --host=localhost:4000
23:19:39 type:info message:!!! DEBUG MODE !!! DEBUGE MODE !!!
23:19:39 type:info message:launch benchmarker
23:19:39 type:warning message:Result not sent to server because API key is not set
23:19:39 type:info message:init environment
23:19:44 type:info message:run benchmark workload: 1
23:20:44 type:info message:finish benchmark workload: 1
23:20:49 type:info message:check banned ips and locked users report
23:21:28 type:report count:banned ips value:0
23:21:28 type:report count:locked users value:2543
23:21:28 type:info message:Result not sent to server because API key is not set
23:21:28 type:score success:4720 fail:0 score:1020
```
## login_log table へ index 追加
```
# phoenix production mode
$ ./benchmarker bench --host=localhost:4000
00:09:59 type:info message:!!! DEBUG MODE !!! DEBUGE MODE !!!
00:09:59 type:info message:launch benchmarker
00:09:59 type:warning message:Result not sent to server because API key is not set
00:09:59 type:info message:init environment
00:10:06 type:info message:run benchmark workload: 1
00:11:06 type:info message:finish benchmark workload: 1
00:11:11 type:info message:check banned ips and locked users report
00:11:14 type:report count:banned ips value:173
00:11:14 type:report count:locked users value:2944
00:11:14 type:debug incomplete_ip:127.1.1.37 reported:true
00:11:14 type:info message:Result not sent to server because API key is not set
00:11:14 type:score success:43050 fail:0 score:9299
```
```
# ruby production mode
$ ./benchmarker bench --host=localhost:8080
23:39:30 type:info message:!!! DEBUG MODE !!! DEBUGE MODE !!!
23:39:30 type:info message:launch benchmarker
23:39:30 type:warning message:Result not sent to server because API key is not set
23:39:30 type:info message:init environment
23:39:35 type:info message:run benchmark workload: 1
23:40:10 type:fail reason:Connection timeout method:GET uri:/stylesheets/isucon-bank.css
23:40:35 type:info message:finish benchmark workload: 1
23:40:40 type:info message:check banned ips and locked users report
23:40:42 type:report count:banned ips value:99
23:40:42 type:report count:locked users value:2768
23:40:42 type:debug incomplete_ip:127.1.0.202 reported:true
23:40:42 type:info message:Result not sent to server because API key is not set
23:40:42 type:score success:26009 fail:1 score:5619
```
## mysql my.cnf 設定追加
```
innodb_buffer_pool_size = 1G
innodb_flush_log_at_trx_commit = 0
innodb_flush_method=O_DIRECT
```
```
# phoenix production mode
$ ./benchmarker bench --host=localhost:4000
00:38:21 type:info message:!!! DEBUG MODE !!! DEBUGE MODE !!!
00:38:21 type:info message:launch benchmarker
00:38:21 type:warning message:Result not sent to server because API key is not set
00:38:21 type:info message:init environment
00:38:28 type:info message:run benchmark workload: 1
00:39:28 type:info message:finish benchmark workload: 1
00:39:33 type:info message:check banned ips and locked users report
00:39:35 type:report count:banned ips value:192
00:39:35 type:report count:locked users value:2987
00:39:35 type:info message:Result not sent to server because API key is not set
00:39:35 type:score success:46950 fail:0 score:10142
```
## workload 増やす
workload=2でもエラーが出るようになったので以下を設定した。
```
$ sudo sysctl -w net.inet.ip.portrange.first=10000
net.inet.ip.portrange.first: 32768 -> 10000
$ sudo sysctl -w net.inet.ip.portrange.hifirst=10000
net.inet.ip.portrange.hifirst: 32768 -> 10000
```
```
# phoenix production mode workload 2
$ ./benchmarker bench --workload 2 --host=localhost:4000
00:55:51 type:info message:!!! DEBUG MODE !!! DEBUGE MODE !!!
00:55:51 type:info message:launch benchmarker
00:55:51 type:warning message:Result not sent to server because API key is not set
00:55:51 type:info message:init environment
00:55:57 type:info message:run benchmark workload: 2
00:56:57 type:info message:finish benchmark workload: 2
00:57:02 type:info message:check banned ips and locked users report
00:57:05 type:report count:banned ips value:257
00:57:05 type:report count:locked users value:3130
00:57:05 type:info message:Result not sent to server because API key is not set
00:57:05 type:score success:63850 fail:0 score:13793
# phoenix production mode workload 3
$ ./benchmarker bench --workload 3 --host=localhost:4000
01:04:11 type:info message:!!! DEBUG MODE !!! DEBUGE MODE !!!
01:04:11 type:info message:launch benchmarker
01:04:11 type:warning message:Result not sent to server because API key is not set
01:04:11 type:info message:init environment
01:04:17 type:info message:run benchmark workload: 3
01:05:20 type:info message:finish benchmark workload: 3
01:05:25 type:info message:check banned ips and locked users report
01:05:27 type:report count:banned ips value:206
01:05:27 type:report count:locked users value:3188
01:05:27 type:debug incomplete_user:timmy_powlowski reported:true
01:05:27 type:info message:Result not sent to server because API key is not set
01:05:27 type:score success:67790 fail:0 score:14645
# phoenix production mode workload 4 エラーが出るようになる
$ ./benchmarker bench --workload 4 --host=localhost:4000
01:10:20 type:info message:!!! DEBUG MODE !!! DEBUGE MODE !!!
01:10:20 type:info message:launch benchmarker
01:10:20 type:warning message:Result not sent to server because API key is not set
01:10:20 type:info message:init environment
01:10:26 type:info message:run benchmark workload: 4
01:11:18 type:fail reason:Response code should be 200, got 500 method:POST uri:/login
01:11:29 type:fail reason:Response code should be 200, got 500 method:POST uri:/login
01:11:29 type:info message:finish benchmark workload: 4
01:11:34 type:info message:check banned ips and locked users report
01:11:37 type:report count:banned ips value:257
01:11:37 type:report count:locked users value:3196
01:11:37 type:info message:Result not sent to server because API key is not set
01:11:37 type:score success:69420 fail:2 score:14996
# ruby は workload=2 でエラーだらけになる(理由は Mysql2::Error - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2):)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment