New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
VPS not using VSwap?
I have an OpenVZ with 256MB RAM and 128MB VSwap, but VSwap is always at 0 (in the control panel and with the free
command).
The VPS keeps running out of memory and killing mariadb before the Swap is used.
The VPS was working fine before (with nginx + PHP + mariadb) but the other day I reinstalled Debian from scratch, so not sure if I need to change anything on the VPS?
Thanks
Comments
Contact the hosting provider, the ability to use swap is limited by your provider
Running mariadb on 256mb ram? 🔥 🔥
Is it? But it's weird that it shows in the control panel (SolusVM I think)
I guess I'll open a ticket and ask
It was running perfectly in the past before I rebuilt it. Maybe I configured it incorrectly? I know in the past you could definitely configured MySQL/MariaDB to use a small amount of RAM.
Or maybe it's just the newer version of Debian. I think I was on 9 before
huh, I ran that on 64MB.
That explains it, i was imagining mariadb 11 running on 256mb ram.
I ran too but it was mariab 5, can't imagine the current releases running fine on less than 512mb of ram.
Check whether
cat /proc/sys/vm/swappiness
is not zero.Just in case, it's in the
/etc/sysctl.conf
file.Although I'm unsure whether you can edit that setting on OpenVZ. Most likely can be done by the provider only.
Noobs will run out of memory just after reading this comment![B) B)](https://lowendtalk.com/resources/emoji/sunglasses.png)
yeah swappiness is set to 0 but can't be changed
Was it sold with the vSwap? Then go claim it.
That's the answer then.
Your VM will not swap until you run out of memory (i.e. when it must swap absolutely), but probably it has not enough time to react.
Contact support and ask for adjustments, so you can use all the swap you paid for.
Apparently it was. Had to use the wayback machine to back like 6 years lol
If it's OpenVZ 7 (ie, the OpenVZ based/running on CentOS 7) -- the vSwap implementation was changed to use the actual SWAP on the host-node (while on OpenVZ 6 vSwap it was using RAM which was slowed down or passed through as SWAP to the container/VPS (afaik).
What could be happening in this case is, if the host-nodes swap is full, the vSwap can't.. allocate any swap to the VPS anymore, I don't remember exactly how the 0 swappiness setting from the host-node would affect the vSwap operation on the VPS, but given that you are running a LEMP stack on 256M + 128M (~384M effectively), it should swap out something pretty quickly I feel as the 256M RAM would be pretty easily filled up?