When your Linux system freezes, what do you do to recover functionality?
(At the point a Linux system has frozen, it's usually too late to summon a command prompt with Ctrl+Alt+F3. The Magic SysRq Key seems like it should be able to duplicate the functionality of CTRL+ALT+DELETE — but so far I haven't successfully used it to recover from freezes, and it isn't usually enabled on friend's computers.)
grep sysr /etc/sysctl.conf
kernel.sysrq = 1
One can also re-map cntrl+alt+del to do anything if the system is not entirely hung and that configuration incantation varies by what init system your machine is using.Another thing to research is tuning options like vm.min_free_kbytes, vm.swappiness, vm.lowmem_reserve_ratio, vm.user_reserve_kbytes, vm.admin_reserve_kbytes, vm.overcommit_ratio and vm.overcommit_memory in /etc/sysctl.conf to swap early, and reserve more memory for the kernel based on how much installed RAM you have available. Just setting vm.overcommit_ratio to 0 can solve some hung systems for a number of people at the expense of some applications not launching when memory is low. Another thing to research if you do not have enough RAM is zswap, especially useful to reduce writes to SSD's. To see if your kernel has zswap support:
modprobe configs && zcat /proc/config.gz | grep -i zswap|grep -v ^#
[1] - https://www.kernel.org/doc/html/v4.15/admin-guide/sysrq.html
You do have a hardware reset button?