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

John Blackbourn johnbillion+wp at gmail.com
Sun Aug 28 14:50:31 UTC 2011


On 28 August 2011 14:45, Ian Douglas <ian at powerfoundation.org> wrote:
> Thank you Joe,
>
> I'm beginning to think there is some kind of limitation in VPS environments. We go from one fatal error to another. It's incredible. Right now we have 502 Bad Gateways, and sometimes 504 Gateway Time-outs. If anything it works at all we have load times of maybe a minute.

Do you have a test or staging environment set up? If not you should
set one up (including the Cloudflare DNS and Nginx reverse proxy) and
see if you can reproduce the problem with a site that's not under
load. If your VPS is struggling then you'll probably need to do this
on a separate server. Once you do this it'll become clear whether the
problem lies with the site structure, or whether it lies with the
site/server when it's under load.

The advantage this gives you is you can also incrementally remove
things (eg. Cloudflare or W3TC) to find the problem.

> I'll try to follow your steps.
>
> I thought a decent VPS would simply work. Even we disable all plugins and it doesn't work.
>
> And as for the plugins, people chime in that there are too many. Yes, if you're running a blog. We're trying to use Wordpress as a CMS to run a fully fledged news site. If we don't have plugins, we don't have functionality. Again, 1.3GB of RAM should handle functionality, no?

In theory, the number of plugins you run is irrelevant, but the
quality and efficiency of those you run is. You could run one terrible
plugin and kill your whole site, or you could run fifty well built
plugins and have no adverse affects (and of course they could actually
speed the site up).

In reality, running fifty plugins on a site *is* likely to cause
problems purely on a probability basis. You're probably running at
least one plugin which is less than optimal in terms of memory use,
database queries, etc.

One resource-intensive plugin might not hurt, but three or four that
eat up memory will soon cause you a problem.

> I think we have a memory leak somewhere. If someone can explain to me what those are like, and how to track them, I'd appreciate it.

If you had a memory leak it should disappear when you disable all your
plugins (unless it's caused by your theme). A memory leak will rear
itself in the form of 'Out of memory' errors in PHP's error log.

xhprof or xdebug are both very good for profiling PHP. I've lost many
an hour going through the swathes of information that xhprof provides,
but if you have a major problem it should be fairly clear fairly
quickly.

> We're look into the debug log. I get hundreds (like may 700 on the frontpage alone) of the following:
>
> Notice: get_settings is deprecated since version 2.1! Use get_option() instead. in/home/bikyaweb/public_html/wp-includes/functions.php on line 3382

You should adjust your PHP error logging level so notices aren't
logged (although I know there is a PHP bug regarding suppressing
notices with certain error logging levels, can't remember what at the
moment).

John


More information about the wp-hackers mailing list