[wp-hackers] Multisite memory issue

Simon Dunton - WP Sites simon at wpsites.co.uk
Thu Nov 7 00:23:34 UTC 2013


Hi Jesse,

In an ideal world your host would install xhprof on your current setup so they/you could log the exact memory usage down to the function level on the infrastructure in question. Alternatively you could mirror your existing configuration as close as possible on a temporary VPS and use xhprof or xdebug to dig deep into your memory usage. Could get a little technical and since your server configuration and traffic levels on this temporary VPS are different to your live setup there is a chance you won't see the memory issue at all. You'd probably need to use something like Apache AB or Siege to generate some requests on your temporary VPS.

There is also New Relic which takes away some of the technicalities of the above approach and presents you with a more friendly, holistic view of your websites performance.

The other more straight forward thing you could try is use something like the plugin performance profiler: http://wordpress.org/plugins/p3-profiler/ which might be able to highlight plugins that take up lots of memory but I've never I've never had much success with this one.

The other thing you could try is Time Stack: https://github.com/joehoyle/Time-Stack/ which is great for profiling chunks of your own code or existing WordPress/plugin functionality once you've worked out how to attach it to existing events.

Sounds like an exciting yet frustrating predicament to be in. Good luck!

Simon

 

On 6 Nov 2013, at 20:22, Jesse Friedman wrote:

> I have a rather large multisite network powering close to 500 sites. We
> don't get a lot of traffic, maybe 250,000 uniques a month.
> 
> Last year we had 100 sites running on a well known WordPress only hosting
> company that uses varnish cache.  We've grown by 400 sites in the last 3
> months and have immediately experienced major memory problems.
> 
> We upgraded our hosting plan and are now running a bare metal box, with
> master / slave database replication.  However we are still seeing some
> memory issues. It is not as bad as it was, but here are some specs and
> symptoms.
> 
> Symptoms:
> 
>   - White screens (not of death), if you simply refresh the page loads.
>   This happens on a site level and occurs about 50 times a day
>   - On a network level sites.php or users.php show white screens for users
>   that frequent the network. The more sites I visit the more likely I will
>   get the white screen. However if I create a brand new super admin user I
>   can browse the network admin just fine
>   - Probably unrelated, the plugins section is no longer identifying
>   plugin upgrade needs. In other words WordPress SEO needs an upgrade now but
>   it isn't telling me or giving me the option to auto update
>   - The site and user count in the dashboard is way off. Now most of these
>   sites were generated by moving them in from another multisite manually
>   through the database
> 
> PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
> allocate 44484 bytes) in /nas/wp/www/sites/__/wp-content/object-cache.php
> on line 196, referer: url of site page
> 
> PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to
> allocate 317441 bytes) in
> /nas/wp/www/sites/__/wp-admin/includes/class-wp-ms-sites-list-table.php on
> line 282
> 
> PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
> allocate 38780 bytes) in /nas/wp/www/sites/__/wp-content/object-cache.php
> on line 196, referer: url of site page
> 
> 
> Specs
> We have hundreds of in house made themes and 1 in house framework plugin.
> Network Activated Plugins:
> 
>   - Akismet
>   - Blog Copier
>   - Breadcrumb NavXT
>   - Gravity Forms
>   - Jetpack
>   - Redirection
>   - Simple 301 Redirects
>   - WordPress Importer
>   - WordPress MU Domain Mapping
>   - WordPress SEO
>   - WP-Paginate
>   - WP Mobile Detect
> 
> 443 themes
> 288 users
> 
> 
> The hosting provider said it was the shear size of our network that
> required us to upgrade the hardware. Now that we are on this super robust
> system, they are convinced its a plugin or theme causing a memory problem.
> 
> *HELP PLEASE! :*)
> 
>   - Has anyone had any luck tracking a memory issue through hundreds of
>   sites, using network activated plugins but hundreds of different themes?
>   - Right now I feel like the memory issue could be either the size of our
>   network or something in our code, but i have no idea how to find the
>   problem.
>      - I have duplicated the network into a staging environment and we
>      have no issues there but there is also no traffic. I believe that I need
>      traffic to the network to be able to duplicate the problem
>      - I can not turn off any of the plugins without breaking the network
>      - I can not turn off any themes without disabling client sites
> 
> 
> -- 
> thanks
> 
> *jesse friedman*
> jes.se.com
> Book: Web Designers Guide to WordPress -
> http://wdgwp.com/onamazon<http://wdgwp.com/onamazon>
> Twitter: @professor <http://twitter.com/professor>
> Facebook: Like<https://www.facebook.com/pages/Jesse-Friedman/204793299545174>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list