On a FreeBSD machine with a bunch of wordpress website jails that work with one database jail, the system might continuously use up swap space if your VM has say 4G or less memory.
If the swap is continuously increasing, figure what is using swap:
top -o swap -n 20And if it is a SQL process, open the following file, provided your db jail is called db0, you are using bastille as your jail application and you’re using Unix socket:
/usr/local/bastille/jails/db0/root/usr/local/etc/mysql/my.cnfand make following edit to the file to make this variable 256 Megabytes (if the existing value is larger than that). Or even 128MB. Simple Wordpress sites work without issues with that much memory:
[mysqld]
innodb_buffer_pool_size = 256MAfter that, restart your jail:
bastille restart db0Now, if you run the top command, your swap should have immediately decreased. And then it’ll continuously decrease over the next few hours.
If you want to decrease swap usage even further, go over to Swap Growing on Your Freebsd Server? Check Your php_fpm Settings - Step 2.
😤