High VPS load

I’m running out of ideas on how to fix this problem. I’ve had a VPS for awhile now, over a year at least, and am running Wordpress 3.5 and a Vbulletin forum with it. Few plugins overall, WP Supercache for the WP site.

It seems like every couple of weeks, or every week in some instances, the server load spikes for a day or two (or three), with it averaging in the 20’s but spending time in the 70’s.

I had it set at 2500 for memory and 2000 for mysql. I’ve been told I needed more ram (though the server status page rarely showed it going above 2000), so I set it to 3500 just to see if it would make an impact.

I’m having no luck at all. I’m not a hugely busy site but I get good traffic. I can’t figure out what would be causing it to spike to these high numbers.

The server load just topped 100. There’s no reason for this, is there?

Mem: 3584000k total, 2672288k used, 911712k free

I am not a VPS Professional, and I do not work for DreamHost. This is just my personal experience:

I also use WordPress, and have WP Multisites set up running several sub-sites. I recently switched to VPS, and had huge spikes that were causing my VPS to be rebooted periodically.
First, I went through and removed all unecessary plugins, and one in particular (a sort of analytics plugin) that I thought might be causing some issues.
Then, I set each domain to use mod_php 5.2.* in the DH Panel under Domains>Edit
Then Under VPS>Configure Server I enabled PHP Cache (xCache) and disabled any other settings (such as Jabber) that I was not using.

…Then…there’s more…
I went here: http://www.7is7.com/software/dreamhost/psmanager.html and downloaded and installed PSManager and PSRebooter, configured according to the instructions there, and set a Cron Job to reboot (using PSRebooter) twice a week at 2 in the morning (this clears out the cache and resets any tasks that are going bonkers).

Wham! No more problems. Server stays under 300mb at all times, and in the rare occasion it goes over (I was running some huge backup routines the other day) PSManager adjusts accordingly and then brings it back down when the task is finished.

Again, I am not any sort of IT VPS guy. Just read through some forums and played around until I found the settings that seemed to work for me.

On a VPS, W3 Total Cache is better than WP Super Cache (since you can hook into more thangs, though it’s way more complicated).

If you’re up to installing xcache on your own, you can keep PHP 5.3 (which uses less memory), but letting the default use 5.2 and xcache is okay too :slight_smile: Then you can tell W3TC to use xcache for your opcode caching :wink:

It shouldn’t be necessary to reboot the server. Which tasks appear to be going bonkers?

On my sites, I notice a steady increase of cached memory over a day or so. Seems to go up on a steady incline (rather than sharp spikes).
From what I have read, currently the only way to clear that cached memory (on DH VPS) is to reboot.

From what I have read, rebooting will also, quite naturally, end any rogue processes that might be going on, although I am not sure if that is my issue or not…

It’s true on most VPS. Are you rebooting just apache (i.e. restarting it) or the whole server?

It sounds very much like you have a rogue process though, if it’s a steady incline.

I have the same issue and am technically challenged. So does anybody know which is true - should you NOT have to reboot? Or is it reasonable to reboot say weekly to avoid the “cache creep” that seems to happen?

If you don’t know of it’s existence check out PS manager… See this thread : https://discussion.dreamhost.com/thread-118806.html

I use PSRebooter on a cron-job to reboot twice a week at 2am. This seems to reset everything.

Interesting side-note: I am currently managing 3 different accounts, each on DH VPS. Each with very similar settings.
One site is Joomla with a huge database and a registration-process on the front
Another is an e-commerce site with medium amount of traffic, running WP and WooCommerce
Another is a WP Multi-site running 10 or so low-traffic websites.

Each of those websites have almost identical cache-creep. Slowly creeping up over a 24-hour period from 0 to 300mb. Each of them when left unchecked would continue to creep up very slowly until it reached whatever max amount of RAM I had set

After discovering PSmanager and PSrebooter, I have each of them set to reboot at 2am twice a week and they never go over 325mb of RAM now. Mostly they stay under 300mb. The WooCommerce site goes over 300mb at least once a day. I suspect a couple of the WooCommerce plugins are the culprits for that…shipping calculators that connect to USPS and UPS…

You should not have to reboot a correctly configured server.

I wouldn’t call it reasonable - but it appears it might be unavoidable under some circumstances.

Here is a sligthly more descriptive discussion on this topic:

[quote]Interesting side-note: I am currently managing 3 different accounts, each on DH VPS. Each with very similar settings.
One site is Joomla with a huge database and a registration-process on the front
Another is an e-commerce site with medium amount of traffic, running WP and WooCommerce
Another is a WP Multi-site running 10 or so low-traffic websites.

Each of those websites have almost identical cache-creep. [/quote]

Well … that IS interesting, and in a weird way comforting that it’s not one app or another. I went back to look at a couple different servers (one not on DreamHost, just for comparison’s sake). I do see cache creep, but it’s generally not problematic (at least on my monolithic VPS, it clears its own swap cache every day without a recycle). I haven’t rebooted in 38 days, though I restarted apache an hour ago when I was making some httpd.conf tweaks. You should never have to reboot like that.

The weird thing to me is that some VPS users were complaining about cache creep at basically “week one” of VPS being offered, and that was quite some time ago now. If it’s not app-specific then you’d think there would be more posts about the apparent need to reboot weekly. It’s a pity happy customers rarely post - it would be great to see someone pipe up with “I don’t suffer from that cache creep stuff… and here’s why!”.

I went to check, but today I posted something new on ElfTest, so it’s not a very good benchmark. Previously, I had no cache creep that I could see.

PHP 5.3, Google PageSpeed, pretty generic server with 400megs VPS.

Same results on a non DH box running PHP 5.4…

It may be worth a ticket to ask if your VPS OS needs to be/can be upgraded.

After watching each of the servers very closely for the last few days, I am starting to wonder if PSRebooter is actually rebooting. Here are my graphs from each one:


I can see a heavy dip at around midnight, but it does not look like a reboot, since the graph does not go all the way to the bottom.

At any rate, it looks like all 3 servers have stayed under 300mb for the last several days, so maybe it just took a while for my change in the PHP and xCache settings to kick in?
For an experiment, I am going to disable PSRebooter on one of the servers and see if the cache will stay level. I will report back in a few days.

Yesterday I disabled the PSReboot routine on one of my VPS, and this morning found that I am still getting the sudden drop in cache memory at midnight.

Previously I had assumed it was PSRebooter doing its work; however, I now think that I had incorrectly set PSRebooter and it was never running.
The sudden drop in cache is either natureally occuring (can I say that about a computer?) or else ottodv has implemented some solution into PSManger (which I DO have configured correctly and runs at regular intervals)

However, I do not think that cache clearning is part of PSManager yet, as the last message I received from otto suggested he is still working on a solution for that.

In summary: I stand corrected about having to reboot to clear my cached memory. It seems that this was occuring already without the need to reboot. I am not sure if this occurs because of my current configuration or because PSManager has a new feature that does this.
I seem to get a cleared cache around midnight of each night according to my graph, so I would assume some sort of cron or routine is doing that?

As a side note to this discussion about rebooting with PsRebooter: If you set up PsManager to e-mail you change notifications, you should have received e-mails notifying you of a reboot (or seen tweets if you set up a twitter account for that through PsManager). Also you can always check how long your system has been up with the command “uptime”, if it was successfully rebooted then uptime should show the time since the last reboot. Finally there is also the optional verbose log, which would log a reboot.

Rebooting is just a way to limit the impact of the real problem (like memory leaks or cache creep). As others have already mentioned you shouldn’t really have to reboot.