Running a large import by hand and taking the machine down with the OOM killer is a recurring way to turn a routine task into an incident.
$ systemd-run --scope -p MemoryMax=1G -p CPUQuota=50%
php artisan import:catalogue
# it gets its own cgroup, so exceeding the limit kills the import
# and nothing else.
$ systemd-run --on-active=30m --unit=deploy-check /usr/local/bin/check.sh
--scope runs it in the foreground and is the form to reach for interactively; without it the command is detached as a transient service and its output goes to the journal. The killed process is the one that exceeded the limit rather than whatever the kernel judged largest, which is the whole point — the default OOM behaviour on a busy host frequently kills the database instead.