VPS exceeded memory help

I’ve had my VPS for almost two years. I got it to run a WP-LMS for a client. It worked rather well so I thought I’d move most of my Shared sites to it. Everything was going fine until this month, I suddenly have exceeded memory reboots everyday. So I tried to track down what the problem was following the advice in the email. I’ve found it really frustrating trying to figure out what exactly is using all the memory. Deciphering the top command is difficult for a non-system guy. This answer has helped understand what some of this means but does not help me track down where my issues my lie.

Example data:
31249 xxx_roy 20 0 381m 68m 26m S 0 5.5 0:19.02 php56.cgi
31140 xxx_roy 20 0 381m 68m 26m S 0 5.5 0:12.59 php56.cgi
22978 xxx_fre 20 0 380m 67m 26m S 0 5.4 0:10.73 php56.cgi
23049 xxx_fre 20 0 379m 66m 26m S 0 5.3 0:07.23 php56.cgi
12969 xxx_roy 20 0 306m 65m 25m S 0 5.3 0:01.45 php56.cgi
7621 xxx_roy 20 0 378m 65m 26m S 0 5.2 0:03.70 php56.cgi
14614 xxx_hb2 20 0 297m 57m 25m S 0 4.6 0:01.98 php56.cgi
14515 xxx_hb2 20 0 296m 56m 25m S 0 4.5 0:01.74 php56.cgi
7816 xxx_bet 20 0 369m 56m 26m S 0 4.5 0:03.47 php56.cgi
26602 xxx_sna 20 0 294m 54m 25m S 0 4.4 0:03.51 php56.cgi
16496 xxx_bet 20 0 294m 54m 25m S 0 4.3 0:01.17 php56.cgi
8338 xxx_sna 20 0 366m 53m 26m S 0 4.2 0:00.97 php56.cgi

I assume the USERs correspond to the websites I have running on the VPS. I also assumed that the multiple instances were web sessions, but when I went and looked at my realtime Google analytics, it did not show any users at all on that site.
My best guess is that I have too many sites running on my low end 1GB memory VPS. So I’ve moved a few back to my shared server. So how many WP sites could I reasonably expect to run on 1GB VPS? Can anyone shed any light on what I’m looking at on my top command?

Hey dtmp, tracing application performances can be quite sophisticated and the answer to your question is not as simple as it may look. On a 1GB VPS you may be able to run dozens of WP sites well or one badly, and unfortunately it depends on too many factors.

I find top is too crude as a tracing tool, most of the times it won’t give you enough details to understand which of your WP sites is being slow and why. That’s why there are companies like newrelic and other offering tools to optimize php code. They’re not super-cheap, though so before you get there you may want to try other approaches (I have no relationship with newrelic https://newrelic.com/php)

I would move your WP sites from shared to VPS one at the time, with a couple of weeks between changes (at least, depending on the amount of traffic they get) and monitor the server, CPU, memory consumption and disk IO as it changes. You’ll have a baseline of resource usage every 2 weeks and you may be able to spot this way the WP installations that is more demanding than others.

hope this helps

What do you recommend to use to monitor these? Those graphs in the VPS dashboard are not very revealing. I notice my memory graph bounces up and down day to day.

I cannot really recommend any of these, as I have only used a couple of them for simple tests. These are popular services that can shed some light:


If you haven’t already, you may want to give a look at this guide for more suggestions, before paying for new services: https://help.dreamhost.com/hc/en-us/articles/214879308-VPS-optimization-overview

Finally, you may want to try to enable the P3 Performance plugin on your sites but be aware that the plugin itself is a resource hog… use it with caution (and disable it when you’re done.)