场景:
今天用jmeter来测试搜索服务的并发性能,1000并发,结果es报错了
org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution of org.elasticsearch.common.util.concurrent.TimedRunnable@69105af3 on QueueResizingEsThreadPoolExecutor[name = gdgt_R4/search, queue capacity = 1000, min queue capacity = 1000, max queue capacity = 1000, frame size = 2000, targeted response rate = 1s, task execution EWMA = 95.6ms, adjustment amount = 50, org.elasticsearch.common.util.concurrent.QueueResizingEsThreadPoolExecutor@39e472bb[Running, pool size = 13, active threads = 13, queued tasks = 4975, completed tasks = 5622440]]
原因:
应该就是并发线程数不够,导致queued tasks太多
解决方法:
在elasticsearch.yml中配置
结果:
elasticsearch支持每秒1000的并发了
但是,在压测这5min内es一直在做垃圾回收
并且cpu占用率也很高
最后测出来的es结果
看起来也不是很好,可能是因为单机的缘故?如果集群化,会不会好一些?