# Need help with Elasticsearch and Elastic agent

**URL:** <https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502>\
**Category:** Elasticsearch\
**Created:** [June 8, 2023, 5:50am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502 "2023-06-08T05:50:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SanketBaraiya](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@SanketBaraiya](https://discuss.elastic.co/u/SanketBaraiya)\
**Post date:** [June 8, 2023, 5:50am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/1 "2023-06-08T05:50:31Z")

</div>

I am facing the problem in my elk server. Whenever I start the elasticsearch service the outgoing traffic increases to \>10 MBps. This is what is shown in the processes.

 ![Processess](https://us1.discourse-cdn.com/elastic/original/3X/4/4/44b7b022e4def09f50188d155524d55392afb93e.png)

I also have stopped both filebeat and metricbeat services. What I think is that maybe elastic agent is upgrading the fleet server, filebeat and metricbeat. How to stop that?

The following command (curl -X GET ":9200/\_cat/nodes?v=true&s=cpu:desc&pretty") give this output:

heap.percent: 52  
ram.percent: 99  
cpu: 38  
load\_1m: 6.18  
load\_5m: 7.04  
load\_15m: 7.56  
node.role: cdfhilmrstw \*  
master name: soc

---

<div class="post-metadata">

**Author:** ![SanketBaraiya](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@SanketBaraiya](https://discuss.elastic.co/u/SanketBaraiya)\
**Post date:** [June 8, 2023, 7:31am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/2 "2023-06-08T07:31:19Z")

</div>

I found that this process is eating the CPU. Any suggestions?

 ![Process](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a94b2071cc881cca29cda530168d64f51c18d36f.png)

---

<div class="post-metadata">

**Author:** ![ahmed\_charafouddine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmed_charafouddine/32/45129_2.png) [@ahmed\_charafouddine](https://discuss.elastic.co/u/ahmed_charafouddine)\
**Post date:** [June 8, 2023, 7:59am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/3 "2023-06-08T07:59:22Z")

</div>

Hello,

On the configuration of the heap memory, it seems to me that elasticsearch recommends that the value of xms be equal to Xmx. However, I see that the elasticsearch process is launched with an Xms 4Mb and an Xmx 64Mb

---

<div class="post-metadata">

**Author:** ![SanketBaraiya](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@SanketBaraiya](https://discuss.elastic.co/u/SanketBaraiya)\
**Post date:** [June 8, 2023, 8:06am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/4 "2023-06-08T08:06:52Z")

</div>

Hi,

I found that the above process is the one using the cpu and memory. As I am new to this I dont know how to optimize that. Will happy to get any help. Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 8, 2023, 10:31pm UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/5 "2023-06-08T22:31:30Z")

</div>

Please don't post pictures of text, logs or code. They are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them 🙂

---

<div class="post-metadata">

**Author:** ![SanketBaraiya](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@SanketBaraiya](https://discuss.elastic.co/u/SanketBaraiya)\
**Post date:** [June 9, 2023, 5:21am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/6 "2023-06-09T05:21:08Z")

</div>

Initial process:

```auto
elastic+ 406465 0.0 0.2 2657952 90936 ? Ssl Jun08 0:43 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=/usr/share/elasticsearch/bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.type=deb -cp /usr/share/elasticsearch/lib/*:/usr/share/elasticsearch/lib/cli-launcher/* org.elasticsearch.launcher.CliToolLauncher -p /var/run/elasticsearch/elasticsearch.pid --quiet

```

Other process:

```auto
elastic+ 406547 52.1 34.7 507693936 11354816 ? Sl Jun08 523:14 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -Djava.security.manager=allow -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 -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=SPI,COMPAT --add-opens=java.base/java.io=ALL-UNNAMED -XX:+UseG1GC -Djava.io.tmpdir=/tmp/elasticsearch-330912685403022393 -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/elasticsearch -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log -Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m -Xms4g -Xmx4g -XX:MaxDirectMemorySize=2147483648 -XX:G1HeapRegionSize=4m -XX:InitiatingHeapOccupancyPercent=30 -XX:G1ReservePercent=15 -Des.distribution.type=deb --module-path /usr/share/elasticsearch/lib -m org.elasticsearch.server/org.elasticsearch.bootstrap.Elasticsearch

```

When I create the .options in jvm.options.d/ with following parameters:

```plaintext
-Xms15g 
-Xmx15g

```

Still the initial process is starting with Xms4m Xmx64m. Any suggestions how to decrease the cpu load and memory consumption. @warkolm

Also can I try and reinstall Elasticsearch and will that remove all the enrolled agents?

---

<div class="post-metadata">

**Author:** ![SanketBaraiya](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@SanketBaraiya](https://discuss.elastic.co/u/SanketBaraiya)\
**Post date:** [June 16, 2023, 11:51am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/7 "2023-06-16T11:51:17Z")

</div>

Any suggestions @warkolm ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 19, 2023, 7:20am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/8 "2023-06-19T07:20:21Z")

</div>

> [@SanketBaraiya](#):
>
> When I create the .options in jvm.options.d/ with following parameters:

What is the actual name of the file you created in there?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 17, 2023, 7:20am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-and-elastic-agent/335502/9 "2023-07-17T07:20:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
