0

在我们的开发环境(ES 单节点设置)中,我们已经看到开放的file descriptors for elastic search are 27491596.

(base) root@root:~$ lsof | awk '{print $2}'| uniq -c | sort -rn | head
      The output information may be incomplete.
27485413 3156
  27000 2578
  18432 2503
  11400 9536
  10584 4987
   5684 15220
   4902 1039
   3840 23025
   3720 23036
   1084 22031
(base) root@root:~$ ps -eAf | grep 3156
root        3156  3100 28 Jun07 ?        1-10:07:07 /opt/jdk-12.0.1/bin/java -Xms4g -Xmx4g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -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-14429444041004318688 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs/hs_err_pid%p.log -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -Djava.locale.providers=COMPAT -XX:UseAVX=2 -Des.cgroups.hierarchy.override=/ -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/usr/share/elasticsearch/config -Des.distribution.flavor=default -Des.distribution.type=docker -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -Ediscovery.type=single-node

它看起来太多了,作为一个运维人员,看到这么多文件描述符让我很担心。有没有办法我们可以尝试减少这种情况?

谁能建议一种处理这种设置的好方法?

(base) root@root:~$ sudo ls -l /proc/3156/fd | wc -l
164593

curl --request GET \
> --url http://localhost:9200/_nodes/stats/process
{"_nodes":{"total":1,"successful":1,"failed":0},"cluster_name":"docker-cluster","nodes":{"jKhiPymDS1GPupuJoqgdOA":{"timestamp":1591949218940,"name":"jKhiPym","transport_address":"172.17.0.3:9300","host":"172.17.0.3","ip":"172.17.0.3:9300","roles":["master","data","ingest"],"attributes":{"ml.machine_memory":"67406077952","xpack.installed":"true","ml.max_open_jobs":"20","ml.enabled":"true"},"process":{"timestamp":1591949218941,"open_file_descriptors":164593,"max_file_descriptors":1048576,"cpu":{"percent":4,"total_in_millis":124889660},"mem":{"total_virtual_in_bytes":135503880192}}}}} ```

This is a copy of the same question [Too Many FD][1]


  [1]: https://discuss.elastic.co/t/too-many-file-descriptors-open/236820
4

0 回答 0