首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ElasticSearch 100% CPU

问ElasticSearch 100% CPU
EN

Stack Overflow用户
提问于 2017-09-25 13:55:18
回答 2查看 1.4K关注 0票数 0

创建类似的主题,以获得更好的问题覆盖率。

使用ElasticSearch 5.4.0作为Windows。Windows 2016,内存为16 GB。

通过命令安装: elasticsearch-service.bat管理器

Java选项:

代码语言:javascript
复制
-Xms8g
-Xmx8g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-Djdk.io.permissionsUseCanonicalPath=true
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-Dlog4j.skipJansi=true
-Delasticsearch
-Des.path.home=C:\elasticsearch
-Des.default.path.logs=C:\elasticsearch\logs
-Des.default.path.data=C:\elasticsearch\data
-Des.default.path.conf=C:\elasticsearch\config

初始内存池: 8192 MB

最大内存池: 8192 MB

线程堆栈大小: 1024 KB。

索引创建后用norconex爬虫填充数据一次。在它完成工作后,任务管理器中几乎所有时间的过程都是100%。它有时会降低到0%或25%,但在一分钟后恢复到95%。

ElasticSearch.log文件中填充了这种类型的记录:

代码语言:javascript
复制
[2017-09-25T16:23:13,166][INFO ][o.e.m.j.JvmGcMonitorService] [Zugx4zq] [gc][9415] overhead, spent [364ms] collecting in the last [1s]
[2017-09-25T16:23:14,534][INFO ][o.e.m.j.JvmGcMonitorService] [Zugx4zq] [gc][9416] overhead, spent [647ms] collecting in the last [1.3s]
[2017-09-25T16:23:15,550][INFO ][o.e.m.j.JvmGcMonitorService] [Zugx4zq] [gc][9417] overhead, spent [397ms] collecting in the last [1s]
[2017-09-25T16:23:16,708][WARN ][o.e.m.j.JvmGcMonitorService] [Zugx4zq] [gc][9418] overhead, spent [657ms] collecting in the last [1.1s]
[2017-09-25T16:23:17,745][INFO ][o.e.m.j.JvmGcMonitorService] [Zugx4zq] [gc][9419] overhead, spent [494ms] collecting in the last [1s]

执行时间过长或失败的请求:

代码语言:javascript
复制
org.elasticsearch.transport.RemoteTransportException: [Zugx4zq][127.0.0.1:9300][indices:data/read/search[phase/query]]
Caused by: org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution of org.elasticsearch.transport.TransportService$7@25194f on EsThreadPoolExecutor[search, queue capacity = 1000, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@48fa409f[Running, pool size = 7, active threads = 7, queued tasks = 1000, completed tasks = 93134]]

org.elasticsearch.transport.RemoteTransportException: [Zugx4zq][127.0.0.1:9300][indices:data/read/search[phase/query]]
Caused by: org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution of org.elasticsearch.transport.TransportService$7@34fbd561 on EsThreadPoolExecutor[search, queue capacity = 1000, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@48fa409f[Running, pool size = 7, active threads = 7, queued tasks = 1000, completed tasks = 118501]]

我不知道是谁在这个服务上产生这样的加载。这些任务从哪里来(排队任务= 1000)?如何监视服务加载?我错过了什么样的微调服务?我不是一个DevOps或者专业的系统管理员,我是一个.net程序员,所以所有这些java应用程序对我来说都是一个黑暗的木头。

更新

服务器RAM增加到32 to。堆大小更改为24 GB。CPU利用率降低到最小值。奇怪的是,使用17k文档和1.1GB大小的索引不是堆大小为8GB的索引。

EN

回答 2

Stack Overflow用户

发布于 2017-09-27 09:12:22

你想知道你在哪里消磨时间。最简单的方法是使用监控插件:您将需要Kibana和X监控插件(免费提供),一些屏幕截图见https://www.elastic.co/products/x-pack/monitoring。

PS:快速看一下,您使用的是默认JVM选项。这通常是好的。不要开始疯狂的调整,它们往往会使情况变得更糟。

票数 0
EN

Stack Overflow用户

发布于 2017-09-27 13:48:25

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46406956

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档