アプリケーションの負荷テストを実行しています。私には2つのサーバーがあります。1つはアプリケーション用で、もう1つは応答を取得するためのダミーサーバーです。
私のダミーサーバーには、次のjspコードがあります。
<%@ page import="java.util.Random" %>
<%@ page language="java" %>
<%@ page session="false" %>
<%
String retVal = "some json string";
Thread.sleep(50);
%>
tomcat7でアプリケーションを実行しています。私のserver.xml接続プール(両方のサーバー)は次のようになります:
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="1500" minSpareThreads="1000" prestartminSpareThreads="true" />
<Connector port="9031" protocol="HTTP/1.1"
connectionTimeout="20000"
maxConnections="4000"
executor="tomcatThreadPool"
redirectPort="8443" />
サーバーから実行しているJavaコードは次のとおりです。
HttpPost post = new HttpPost(bidderUrl);
post.setHeader("Content-Type", "application/json");
// I'm using http client with ThreadSafeClientConnManager
// total conn = 500, max conn per route = 100, timeout=500millis
HttpClient httpClient = httpClientFactory.getHttpClient();
try {
post.setEntity(new StringEntity(jsobBidRequest));
HttpResponse response = httpClient.execute(post);
...
catch (NoHttpResponseException e){
log.error(e);
}
私は50の同時スレッド(ループなし)でJmetterを実行しており、次のような多くの例外が発生します。
org.apache.http.NoHttpResponseException The target server failed to respond
5つまたは10の同時スレッドを実行している間は、すべて問題なく動作します。
私のセットアップで何が間違っている可能性があるか教えていただけますか?私の理解では、50の同時スレッド要求に対してエラーは表示されません。