Elasticsearch RestClient Slow Concurrency Slow Performance
Asked by: Gary Hall 238 views IT
HttpAsyncResponseConsumerFactory.HeapBufferedResponseConsumerFactory consumerFactory = new HttpAsyncResponseConsumerFactory.HeapBufferedResponseConsumerFactory(30 * 1024 * 1024);
Response response = ElasticsearchProperties.restClient.performRequest(
"GET",
"/"+index+"/_search",
new HashMap<String, String>(),
new NStringEntity(queryJson, ContentType.APPLICATION_JSON),consumerFactory);
高并发后ES请求时间比ES查询的took时间长了非常多,并且更多并发并不能提升效率
目前设置如下:
private static final int CONNECT_TIME_OUT = 1000;
private static final int SOCKET_TIME_OUT = 30000;
private static final int CONNECTION_REQUEST_TIME_OUT = 500;
private static final int MAX_CONNECT_NUM = 10000;
private static final int MAX_CONNECT_PER_ROUTE = 1000;
0 Answers