Swap Growing on Your Freebsd Server? Check Your Database Settings - Step 1

Published: Jan 9, 2026

On a FreeBSD machine with a bunch of wordpress website jails that work with one database jail, the system might continuosly 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 20

And 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.cnf

and 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 = 256M

After that, restart your jail:

bastille restart db0

Now, if you run the top command, your swap should have immediately decreased. And then it’ll continously 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.

😤

[web] · [in] · [fb] · [ig] · [x] · [tt] · [yt]

Previous Post
Next Post