JMeterでタコ殴りにしたけどエラーが出る場合の対処。とりあえずポートを増やせ。

2018年11月26日

今回は、軽い感じで1台のLinux上のJMeterでALBをタコ殴りにしたのですがエラーが多発。
下は実際に動かした場合。

[root@ip-10-0-1-148 bin]# ./jmeter -n -t test.jmx -l test.jtl -e -o report -Dsun.net.inetaddr.ttl=0
Creating summariser <summary>
Created the tree successfully using test.jmx
Starting the test @ Fri Nov 23 06:57:36 UTC 2018 (1542956256809)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary +  35090 in 00:00:23 = 1529.6/s Avg:     6 Min:     1 Max:    64 Err:     0 (0.00%) Active: 20 Started: 20 Finished: 0
summary +  39345 in 00:00:30 = 1311.5/s Avg:    23 Min:     1 Max:   220 Err: 17971 (45.68%) Active: 45 Started: 45 Finished: 0
summary =  74435 in 00:00:53 = 1406.0/s Avg:    15 Min:     1 Max:   220 Err: 17971 (24.14%)
summary +  41885 in 00:00:30 = 1396.2/s Avg:    40 Min:     2 Max:  1238 Err:  9560 (22.82%) Active: 70 Started: 70 Finished: 0
summary = 116320 in 00:01:23 = 1402.4/s Avg:    24 Min:     1 Max:  1238 Err: 27531 (23.67%)
summary +  37851 in 00:00:30 = 1261.7/s Avg:    64 Min:     2 Max:  1129 Err: 13712 (36.23%) Active: 95 Started: 95 Finished: 0
summary = 154171 in 00:01:53 = 1365.1/s Avg:    34 Min:     1 Max:  1238 Err: 41243 (26.75%)
summary +  39970 in 00:00:30 = 1332.3/s Avg:    78 Min:     2 Max:  3317 Err: 11460 (28.67%) Active: 120 Started: 120 Finished: 0
summary = 194141 in 00:02:23 = 1358.2/s Avg:    43 Min:     1 Max:  3317 Err: 52703 (27.15%)
summary +  39579 in 00:00:30 = 1318.0/s Avg:    98 Min:     1 Max:  3057 Err: 11625 (29.37%) Active: 145 Started: 145 Finished: 0
summary = 233720 in 00:02:53 = 1351.2/s Avg:    52 Min:     1 Max:  3317 Err: 64328 (27.52%)
summary +  41427 in 00:00:30 = 1382.3/s Avg:   111 Min:     2 Max:  1687 Err: 17170 (41.45%) Active: 170 Started: 170 Finished: 0
summary = 275147 in 00:03:23 = 1355.8/s Avg:    61 Min:     1 Max:  3317 Err: 81498 (29.62%)
summary +  41635 in 00:00:30 = 1387.8/s Avg:   126 Min:     1 Max:  3322 Err:  9428 (22.64%) Active: 195 Started: 195 Finished: 0
summary = 316782 in 00:03:53 = 1359.9/s Avg:    70 Min:     1 Max:  3322 Err: 90926 (28.70%)
summary +  39545 in 00:00:30 = 1318.2/s Avg:   146 Min:     1 Max:  1793 Err: 19331 (48.88%) Active: 200 Started: 200 Finished: 0
summary = 356327 in 00:04:23 = 1355.2/s Avg:    78 Min:     1 Max:  3322 Err: 110257 (30.94%)
summary +  43807 in 00:00:30 = 1460.2/s Avg:   134 Min:     1 Max:  3324 Err:  7557 (17.25%) Active: 200 Started: 200 Finished: 0
summary = 400134 in 00:04:53 = 1365.9/s Avg:    84 Min:     1 Max:  3324 Err: 117814 (29.44%)
summary +  37850 in 00:00:30 = 1261.7/s Avg:   153 Min:     1 Max:  1331 Err: 21056 (55.63%) Active: 200 Started: 200 Finished: 0
summary = 437984 in 00:05:23 = 1356.2/s Avg:    90 Min:     1 Max:  3324 Err: 138870 (31.71%)
summary +  49330 in 00:00:30 = 1644.3/s Avg:   117 Min:     2 Max:  1347 Err:  9660 (19.58%) Active: 200 Started: 200 Finished: 0
summary = 487314 in 00:05:53 = 1380.7/s Avg:    93 Min:     1 Max:  3324 Err: 148530 (30.48%)
summary +  36326 in 00:00:30 = 1210.9/s Avg:   156 Min:     1 Max:  2612 Err: 22268 (61.30%) Active: 200 Started: 200 Finished: 0
summary = 523640 in 00:06:23 = 1367.4/s Avg:    97 Min:     1 Max:  3324 Err: 170798 (32.62%)
summary +  50612 in 00:00:30 = 1687.1/s Avg:   117 Min:     3 Max:  1801 Err:  8206 (16.21%) Active: 200 Started: 200 Finished: 0
summary = 574252 in 00:06:53 = 1390.6/s Avg:    99 Min:     1 Max:  3324 Err: 179004 (31.17%)
summary +  35745 in 00:00:30 = 1191.5/s Avg:   161 Min:     1 Max:  1591 Err: 23170 (64.82%) Active: 200 Started: 200 Finished: 0
summary = 609997 in 00:07:23 = 1377.2/s Avg:   103 Min:     1 Max:  3324 Err: 202174 (33.14%)
summary +  47897 in 00:00:30 = 1596.5/s Avg:   125 Min:     1 Max:  3305 Err:  4008 (8.37%) Active: 200 Started: 200 Finished: 0
summary = 657894 in 00:07:53 = 1391.1/s Avg:   104 Min:     1 Max:  3324 Err: 206182 (31.34%)
summary +  34639 in 00:00:30 = 1154.7/s Avg:   161 Min:     1 Max:  1328 Err: 23825 (68.78%) Active: 200 Started: 200 Finished: 0
summary = 692533 in 00:08:23 = 1377.0/s Avg:   107 Min:     1 Max:  3324 Err: 230007 (33.21%)
summary +  48921 in 00:00:30 = 1630.6/s Avg:   122 Min:     1 Max:  7114 Err:  3391 (6.93%) Active: 200 Started: 200 Finished: 0
summary = 741454 in 00:08:53 = 1391.2/s Avg:   108 Min:     1 Max:  7114 Err: 233398 (31.48%)
summary +  29875 in 00:00:30 =  995.8/s Avg:   191 Min:     6 Max:  1121 Err: 21572 (72.21%) Active: 200 Started: 200 Finished: 0
summary = 771329 in 00:09:23 = 1370.2/s Avg:   111 Min:     1 Max:  7114 Err: 254970 (33.06%)
summary +  49217 in 00:00:30 = 1640.6/s Avg:   120 Min:     1 Max:  3326 Err:  3578 (7.27%) Active: 200 Started: 200 Finished: 0
summary = 820546 in 00:09:53 = 1383.9/s Avg:   112 Min:     1 Max:  7114 Err: 258548 (31.51%)
summary +   7350 in 00:00:07 = 1030.0/s Avg:   187 Min:     7 Max:   796 Err:  4708 (64.05%) Active: 0 Started: 200 Finished: 200
summary = 827896 in 00:10:00 = 1379.6/s Avg:   112 Min:     1 Max:  7114 Err: 263256 (31.80%)
Tidying up ...    @ Fri Nov 23 07:07:37 UTC 2018 (1542956857138)

jmeterでタコ殴りにするとエラーが発生する場合
エラー内容は以下ですがどんなエラーでとりあえず同じ初手。

Non HTTP response code: java.net.NoRouteToHostException/Non HTTP response message: Cannot assign requested address (Address not available)

サーバー側やALP側でエラー発生してないことを確認
負荷かける側の問題です。

たぶんポートが足りてません

増やすの忘れてた。

/etc/sysctl.conf に追記します。

net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240    65535

反映させます。

sysctl -p

OS再起動します。

Windows の場合は下記
https://docs.microsoft.com/en-us/biztalk/technical-guides/settings-that-can-be-modified-to-improve-network-performance

netsh int ipv4 set dynamicport tcp start=1025 num=64511

ソケットが閉じる時間も小さくします。
TcpTimedWaitDelayの30とします。
OS再起動しないとだめみたいです。

再度、負荷をかけます。

[root@ip-10-0-1-148 bin]# ./jmeter -n -t test.jmx -l test.jtl -e -o report -Dsun.net.inetaddr.ttl=0
Creating summariser <summary>
Created the tree successfully using test.jmx
Starting the test @ Fri Nov 23 07:17:09 UTC 2018 (1542957429814)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary +  41924 in 00:00:20 = 2106.8/s Avg:     4 Min:     1 Max:   154 Err:     0 (0.00%) Active: 17 Started: 17 Finished: 0
summary +  69116 in 00:00:30 = 2303.9/s Avg:    12 Min:     1 Max:  1051 Err:     0 (0.00%) Active: 42 Started: 42 Finished: 0
summary = 111040 in 00:00:50 = 2225.3/s Avg:     9 Min:     1 Max:  1051 Err:     0 (0.00%)
summary +  69076 in 00:00:30 = 2302.5/s Avg:    23 Min:     1 Max:  3063 Err:     0 (0.00%) Active: 67 Started: 67 Finished: 0
summary = 180116 in 00:01:20 = 2254.3/s Avg:    14 Min:     1 Max:  3063 Err:     0 (0.00%)
summary +  69075 in 00:00:30 = 2302.5/s Avg:    34 Min:     1 Max:  3240 Err:     0 (0.00%) Active: 92 Started: 92 Finished: 0
summary = 249191 in 00:01:50 = 2267.5/s Avg:    20 Min:     1 Max:  3240 Err:     0 (0.00%)
summary +  69104 in 00:00:30 = 2303.5/s Avg:    45 Min:     1 Max:  7300 Err:     0 (0.00%) Active: 117 Started: 117 Finished: 0
summary = 318295 in 00:02:20 = 2275.2/s Avg:    25 Min:     1 Max:  7300 Err:     0 (0.00%)
summary +  69151 in 00:00:30 = 2305.0/s Avg:    55 Min:     1 Max:  7266 Err:     0 (0.00%) Active: 142 Started: 142 Finished: 0
summary = 387446 in 00:02:50 = 2280.4/s Avg:    31 Min:     1 Max:  7300 Err:     0 (0.00%)
summary +  71065 in 00:00:30 = 2368.8/s Avg:    64 Min:     2 Max: 15507 Err:     0 (0.00%) Active: 167 Started: 167 Finished: 0
summary = 458511 in 00:03:20 = 2293.7/s Avg:    36 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  81543 in 00:00:30 = 2718.1/s Avg:    66 Min:     1 Max:  7316 Err:     0 (0.00%) Active: 192 Started: 192 Finished: 0
summary = 540054 in 00:03:50 = 2349.1/s Avg:    40 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79259 in 00:00:30 = 2642.1/s Avg:    75 Min:     5 Max:  3542 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 619313 in 00:04:20 = 2382.9/s Avg:    45 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79259 in 00:00:30 = 2641.9/s Avg:    75 Min:     4 Max:  3596 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 698572 in 00:04:50 = 2409.7/s Avg:    48 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79220 in 00:00:30 = 2640.7/s Avg:    75 Min:     6 Max:  3555 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 777792 in 00:05:20 = 2431.4/s Avg:    51 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79246 in 00:00:30 = 2641.6/s Avg:    75 Min:     3 Max:  7526 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 857038 in 00:05:50 = 2449.4/s Avg:    53 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79286 in 00:00:30 = 2642.9/s Avg:    75 Min:     3 Max:  3300 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 936324 in 00:06:20 = 2464.7/s Avg:    55 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79307 in 00:00:30 = 2643.4/s Avg:    75 Min:     4 Max:  4040 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 1015631 in 00:06:50 = 2477.7/s Avg:    57 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79259 in 00:00:30 = 2642.1/s Avg:    75 Min:     3 Max:  3792 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 1094890 in 00:07:20 = 2489.0/s Avg:    58 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79263 in 00:00:30 = 2642.1/s Avg:    75 Min:     4 Max:  4620 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 1174153 in 00:07:50 = 2498.7/s Avg:    59 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79233 in 00:00:30 = 2641.1/s Avg:    75 Min:     7 Max:  3665 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 1253386 in 00:08:20 = 2507.3/s Avg:    60 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79224 in 00:00:30 = 2640.8/s Avg:    75 Min:     7 Max:  4073 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 1332610 in 00:08:50 = 2514.8/s Avg:    61 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79226 in 00:00:30 = 2640.9/s Avg:    75 Min:     7 Max:  7036 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 1411836 in 00:09:20 = 2521.6/s Avg:    62 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  79250 in 00:00:30 = 2641.7/s Avg:    75 Min:     4 Max:  6905 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary = 1491086 in 00:09:50 = 2527.7/s Avg:    63 Min:     1 Max: 15507 Err:     0 (0.00%)
summary +  26960 in 00:00:11 = 2475.0/s Avg:    76 Min:     8 Max:  3516 Err:     0 (0.00%) Active: 0 Started: 200 Finished: 200
summary = 1518046 in 00:10:01 = 2526.7/s Avg:    63 Min:     1 Max: 15507 Err:     0 (0.00%)
Tidying up ...    @ Fri Nov 23 07:27:10 UTC 2018 (1542958030893)

エラーが出ませんでした。めでたしめでたし。

その他,運用jmeter

Posted by jkudo