[wp-hackers] APC-Nginx-Apache problems / memory problems on VPS

Ian Douglas ian at powerfoundation.org
Fri Aug 26 22:49:03 UTC 2011


I'm on a Level 3 HostGator VPS: 1.13Ghz / 768MB RAM / 30GB HD / 500GB bandwidth.

I have a site that usually serves 4000 pages a day.

I just renewed my Wordpress site with a new theme (commerically available from a reputable company, so I'm pretty confident of the code) and some extra plugins for functionality. Before renewing, sometimes I'd get database connection errors on the shared account I was on. Eventually, I had to move to the VPS because the site was deemed to be pulling too many server resources.

I was being suspended.

So we did the move. Then the trouble really started.

Even with 768MB RAM, I can't keep the site up. HostGator admins at first said I should disable plugins (I hate this kind of response; it is avoidance. The plugins are there for essential functionality; the question is how to get the install I want to work). In reality, there are only a few plugins that actually add to what is rendered on the main page. So far as I can see, there's nothing there that should be a massive resource hog. And there's nothing that I haven't used without problems before in a shared hosting environment.

In an effort to minimise the load on the server I did the following:

1. Activated W3 Total Cache and a good number of its options
2. Established an account with CloudFlare and changed the DNS so I'm using their caching / CDN system
3. Configured APC to take the load off php
4. Configured Nginx to work as a reverse proxy on the server

This combination, at least according to some, is about state of the art when it comes to performance Wordpress sites. 

But after configuring both Apache and Nginx, and getting both processes restarted, the site doesn't work. Apparently Nginx drops connections to clients.

Both httpd and nginx daemons are running fine and the config check for both yields "Success" or "OK" output!.

Apache's port is set to 81 and it is the stock Apache that comes with CPanel.
Nginx is taking over port 80

The site is not working even if you connect to http://mysite.com:81

Using Easyapache to rebuild the httpd server did not positively affect the situation.

Here are the Config Check Outputs:


root at server [/usr/local/nginx/sbin]# apachectl configtest
Syntax OK


root at server [/usr/local/nginx/sbin]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful


root at server [/usr/local/nginx/sbin]# ps -ef | grep -i nginx
root      1202     1  0 15:39 ?        00:00:00 nginx: master process ./nginx
nobody    1203  1202  0 15:39 ?        00:00:00 nginx: worker process
root      1422  1147  0 15:46 pts/1    00:00:00 grep -i nginx


root      1455  1147  0 15:47 pts/1    00:00:00 grep -i httpd
root     32662     1  0 15:39 ?        00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody   32677 32662  0 15:39 ?        00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
root     32684 32662  0 15:39 ?        00:00:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody   32687 32662  0 15:39 ?        00:00:00 /usr/local/apache/bin/httpd -k start -DSSL

Does anyone have any experience of getting APC, Nginx, Apache, Cloudflare and W3 Total Cache to play together on a VPS?

The site has been down now two days. I'm desperate to troubleshoot this to get it back.

Would really appreciate some help.


More information about the wp-hackers mailing list