I have upgraded my cloud server with using 2Gb of ram.
Now everything works.
However ElasticSearch is taking quite all ram…
It should be usefull to understand where to change max ram of jvm
Elasticsearch behaviour is not tested with such memory limitation but considering that load on ES in this use case is minimal I suppose it can work normally, so, you can try if you want.
Thanks @0lmi, this solves the issue for mender-elasticsearch. I am using mender-server v2.2
Can you provide a benchmark metric for elasticsearch that can help understand how much memory can be allotted to it based upon the need?
I am using the above provided patch, while running the mender server on an Amazon EC2 instance with 1 gb RAM. I see the RAM usage going up with time despite the fix.
Almost on the verge. It reached 800M+ when the provided small and max heap values were 10M and 150M respectively. In some instances, the Mender UI stopped responding properly as it was unable to process requests because of it, while an active deployment was going on for a Singel device.
Temporary-Solution:
I have temporarily tried to solve it using a Swap partition. The RAM start with 700M+ and later occupies about 500M-600M range over a period of time as the Swap is being utilized. Occupied Swap size is 160
Here’s the link to a Screenshot for the HTOP command
If you want to optimise memory usage by Elasticsearch then you can contact Elasticsearch community with a questions regarding minimal heap size and memory usage.
Your’s temporary solution should work ok in this case because Mender services doesn’t generate significant load on Elasticsearch, it’s important part but with no intensive usage. Alternatively you can just increase memory to 2Gb as @zumiani did.