非常に単純化された Undertow 構成を実行しています。コード全体が含まれています:
public class HelloWorldUndertow {
public static void main(String[] args) {
Undertow undertow = Undertow.builder()
.addHttpListener(9090, "0.0.0.0")
.setHandler(new HttpHandler() {
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
exchange.setResponseCode(200);
exchange.getResponseSender().send("hello!");
}
}).build();
undertow.start();
}
}
1 秒あたりに処理できるリクエスト数をテストしようとしています。ab
測定にApacheツールを使用しています:
ab -n 100000 -c 10 http://localhost:9090/test
私が得ることができた最大の数は、約 10000 3/秒です。
Concurrency Level: 10
Time taken for tests: 10.664 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 10000000 bytes
HTML transferred: 600000 bytes
Requests per second: 9377.69 [#/sec] (mean)
Time per request: 1.066 [ms] (mean)
Time per request: 0.107 [ms] (mean, across all concurrent requests)
Transfer rate: 915.79 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 1
Processing: 0 1 0.5 1 11
Waiting: 0 1 0.5 1 11
Total: 0 1 0.5 1 11
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 2
95% 2
98% 2
99% 2
100% 11 (longest request)
私はそれが大きいことを理解していますが、この場合の制限要因は何なのか知りたいです. これはプロセッサではなく (Java Mission Control を使用してサンプリングした場合、アプリは 20% 未満で実行されています)、メモリではありません。Windows で実行していますが、それが原因でしょうか?