c# - 检查 Elasticsearch 堆大小

标签 c# .net elasticsearch

我如何检查分配给 Elasticsearch 引擎的堆大小,有没有办法使用 URL API 来检查它?我可以使用 NEST 来检查吗?

谢谢

最佳答案

在集群环境中,堆设置可以查询为:

curl -sS  "localhost:9200/_cat/nodes?h=heap*&v"

例如:

curl -sS  "localhost:9200/_cat/nodes?h=heap*&v"
heap.current heap.percent heap.max
     321.1mb           32  989.8mb
     424.1mb           42  989.8mb
     280.3mb           28  989.8mb

这也可以从 ps 结果中检查出来,尽管它只会阐明最小值-最大值。

~#ps aux | grep --color=auto -i Xms
elastic  6020  0.0  0.0  12788   936 pts/4    S+   04:24   0:00 grep --color=auto -i Xms elastic+  7218
0.6  9.5 5001220 1565112 ?     Ssl  Jun24   5:14 /usr/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=/tmp/elasticsearch.WoiU4NhH -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/elasticsearch -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/log/elasticsearch/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -Xms1g -Xmx1g -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=deb -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet

其中 -Xms 是最小堆,-Xmx 是配置的最大堆。

关于c# - 检查 Elasticsearch 堆大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32100072/

相关文章:

c# - 在 Entity Framework Core 上禁用 AutoDetectChanges

c# - 在c#中更改FileStream的长度

c# - 使用 AutoFixture 对 Html 助手进行单元测试

c# - 如何解决已停止的 Windows 服务 'clr.dll 错误?

.net - CLR 在非 CLR 创建的线程中托管异常处理

.net - .net 4 中添加的所有并发数据结构的列表?

c# - 禁用 Alt+F4 但允许通过代码关闭表单,CloseReason.UserClosing 没有帮助

elasticsearch - 平面文档与嵌套文档的性能缺陷是什么?

regex - ElasticSearch按正则表达式排序

ruby - 如何从Logstash中的嵌套对象中删除点