Which Process the OOM Killer Picks
When memory runs out, how can you make the kernel's OOM killer prefer not to kill a critical database?
Choose one answer
Add more swap, which turns off the OOM killer.
Lower its oom_score_adj (for example OOMScoreAdjust=-900 in its unit).
oom_score_adj
OOMScoreAdjust=-900
Give the database a higher CPU priority with nice -n -20.
nice -n -20
Run it as root, because the OOM killer never kills root's processes.