Can you not protect processes from the oomkiller? This is trivial and very useful on FreeBSD
mysql_enable="YES" mysql_oomprotect="YES"
Now every time you start the MySQL service it's automatically protected
oom-kill-protect fromenv
And the conversion from something like OOMScoreAdjust is quite straightforward. A PostgreSQL systemd unit file that read OOMScoreAdjust=-625 becomes a run program that contains oom-kill-protect -- -625
* http://marc.info/?l=freebsd-hackers&m=145425153624976&w=2* http://jdebp.eu./Softwares/nosh/guide/oom-kill-protect.html