Xms represents the initial size of total heap space
Xmx represents the maximum size of total heap space
-Xms4g
-Xmx4g
I have some questions:
Graylog and Elastichsearch Heap size is set for 4GB, but in reality Graylog is taking 4720M and Elasticsearch is taking 4993M Ram. Is it normal like this?
Why MongoDB is taking too much RAM. Can I limit the RAM for MongoDB?
Even RAM is showing high, but there is no issue until now. It’s ok like this or is there any potential issue for the future?
The Ram-Usage of Mongo is sometimes a bit strange. In older versions the Garbage collector needed to collect stuff, and the trigger for that was (default) 50% of total RAM or so. I think this might be the case in your instance as well. After a restart of Mongo this gets better, as long as there is not so much activity around mongo.
Thank you for your reply. Is it safe to restart MongoDB, will I lose any logs? if MongoDB after restart will raise the RAM again and doesn’t crash the machine, then I don’t have any problem to keep it like this.
In the time there is no mongo available the Graylog will be unhappy. I assume a Mongo-Restart should not take longer than 30 seconds. Depending on your log-sources you will miss some logs (UDP), or the application might be so smart and buffer them.