Websites getting down every day on VPS Server

I have a VPS server using 4 CPU and 4GB RAM shared across 10 PHP websites of which 2 website(website and set cron jobs) are using sometime more than 6 CPU core of 4 CPU core available. And because of that all websites getting down and show this error "508 Resource Limit Is Reached".

The website is temporarily unable to service your request as it exceeded resource limit. Please try again later.

What should I do for this issue relative to one site won’t affect to other? All websites are getting down daily basis. Please help me. Thank you.

When sites are getting down, at that time server load is high.

Support people said that if you increase the RAM 4GB to 8GB, then we see how it handles the server. but they didn't provide actual solution.


Solution 1:

In short:

At peak loads your server does not have sufficient resources to meet all demands and because all sites run on the same server, they all suffer.

Typically you add monitoring to find out which processes, site(s) and/or system components are the cause(s) and which resources are the limiting factor.

Then you can either:

  • add more resources (upgrade your VPS with more RAM, CPU, faster disks etc.)
  • optimise your code so it makes better use of the existing resources (for example: tune database queries, add caching etc.)
  • add resource limits to each individual process and/or site so they won't starve the other processes.