I have a vital service running a Ubuntu(20.04.1) server. Recently it is always killed by OS.
At first I guess that probably is resulted by the OOM(out of memory) operation of OS, so I modified the systemd service unit file(my_app.service) of my app, and add a option OOMScoreAdjust=-1000
. Of course followed by a systemctl daemon-reload
.
But my app still is killed by OS!
Now I have to inspect the real reason why OS always kills my app.
BTW, there is 2G RAM and 4G swap space. When my app being killed, almost entire swap space is free. My app should is a good program because it is running normally on another Ubuntu(20.04) server that has 4G RAM and 4G swap.
How to find out the real reason? (/proc/sys/vm/swapness is 65)
Any hints will be appreciated!