I recently applied the following setup to install WordPress plus W3 Total Cache on an nginx server with a varnish frontend to achieve high scalability. It works great when I'm only running one virtual server, but once I configure more than 1-2 WordPress sites on the same server, the CPU maxes out at 400%, with varnish being the culprit:
763 nobody 20 0 166m 16m 7840 S 400 3.4 5437:22 varnishd
The amount of free memory is the same before and after this CPU spike, about 25-30 megs based on top
.
None of my sites get any amount of traffic right now (at max several hundred real page impressions a day). I'm hosting on a Linode 512 meg VPS and followed the setup details from the blog post, with the exception of a different permalink structure. I do have a few plugins installed and migrated my WordPress installs over by copying a tar file and MySQL dump from the old host.
For starters, how would I go about debugging this further? Is this purely a varnish problem? Am I not purging the cache properly, once I started applying this setup to multiple sites?
I've also seen some debate as to whether varnish is even desirable for this kind of a setup. Should I just use nginx as a reverse proxy instead?
(Note that I've posted this on WordPress Stack Exchange too, but it was suggested it may be off topic there)