Where measure can be anything from htop/atop over https://github.com/cdown/psi-notify , to https://github.com/noiseonwires/memory-pressure and so on.
To understand what these sysctls are about, how they are related to each other, and to ZRAM, I'd recommend reading, or at least skimming https://chrisdown.name/2018/01/02/in-defence-of-swap.html , https://chrisdown.name/2019/07/18/linux-memory-management-at... , https://linuxblog.io/linux-performance-almost-always-add-swa... , https://linuxblog.io/linux-performance-almost-always-add-swa... , https://linuxblog.io/linux-performance-no-swap-space , https://linuxblog.io/running-out-of-ram-linux-add-zram , https://github.com/ValveSoftware/SteamOS/issues/899 , https://lonesysadmin.net/2013/12/22/better-linux-disk-cachin... , https://github.com/CachyOS/CachyOS-Settings/pull/19 , https://github.com/CachyOS/CachyOS-Settings , https://docs.kernel.org/admin-guide/sysctl/vm.html , https://docs.kernel.org/accounting/psi.html , https://facebookmicrosites.github.io/psi/docs/overview , https://unixism.net/2019/08/linux-pressure-stall-information...
even if it seems redundant, OFC skim and discard anything you already know(But I can't know that).
The following not to use them, but for their POVs/concepts regarding the same problem: https://github.com/facebookincubator/oomd , https://github.com/rfjakob/earlyoom , https://github.com/hakavlad/nohang
These, to maybe take inspiration from, to adjust dynamically:
https://www.linuxbash.sh/post/tune-vmswappiness-in-a-script-... , https://github.com/lululoid/LMKD-PSI-Activator (Yes, Android, I know, but still...)
Then there is the whole thing about eBPF, which opens up much more screws to turn dynamically according to demand, according to whichever policies.
https://www.brendangregg.com/ebpf.html / https://deepwiki.com/oracle/bpftune/1-overview
Have fun :)