Recovering from memory saturation


Memory saturation is when your PS is using up its entire allotment of memory. When this happens, a variety of things will start to happen. Your sites will likely stop responding in many cases, but beyond that other essential processes on your PS will stop responding as well such as the SSH server, FTP server, streaming media server, and so. It's entirely possible for your VPS to enter a state where you can't even log in due to memory saturation.

Checking for the cause

You can usually tell if this is happening to you by checking a few things:

If the resource usage graph is showing your memory spiking high above the memory allocated, then this is likely what's happening. If you can still log in to your PS via SSH, then try running the free -m command. This will show you how much free memory you have available. The closer that is to zero, the worse you are. At zero, you've reached total memory saturation, and what happens next can be unpredictable.

Once you've determined that there is no free memory available, the fastest way to resolve it is to temporarily increase the memory allocation for your PS until you have some breathing room (unutilized and freely available memory). At that point, you can either leave the memory allocation there until you optimize your site and server and get your memory usage under control. Otherwise, you can start disabling your active sites until your memory gets into a range you are more comfortable with. This gives you room to optimize without having to spend more money on memory.

It's best to over allocate than under allocate! You don't want to find out that you've under allocated by your visitors/customers complaining about your sites not working properly.

You're only charged for the period of time that you have the slider in a particular position, so it's safe to experiment.

  • One easy way to disable a site is to simply rename its web directory. For example, if you had a domain titled, you could rename its web directory from to example.com_disabled. By doing this, Apache will start serving 404 Not Found error pages for that domain. While this will still require memory, it will keep new PHP processes from spawning and will likely reduce traffic significantly to the point where your server is no longer overloaded.

See also

Did this article answer your questions?

Article last updated PST.