How to boost the performance of a WP site with many logged in users?

Hi,

I've just inherited the hosting of a WP project, the core of which are some 10,000 users.

Now, I'm not much of a sysadmin. I just run a bunch of modest cloud-based Linux boxes for a number of projects as the resident "You know about computers!" at my place of employment. Most projects are straightforward, so I leverage a bit of caching (typically Varnish) and I have enough of a grasp of the fundamentals of hosting content-driven WP sites to avoid a few common pitfalls.

But this project? It's got me somewhat stumped. Caching doesn't appear practical, and in general most strategies appear to centre around serving rarely-changing content that is common to all visitors.

I'm aware of the importance of performance profiling, but before I begin digging around I wondered what general strategies might be available be for boosting the performance of WP websites where the vast majority of the content is tailored to individual users.

Note that I don't have a huge amount of control when it comes to the application itself. Issues that relate to the overall execution of WP could be my domain, but when it comes to looking closely at application logic, I'd much prefer to maintain a boundary between hosting and development - mostly so that the scope of the project remains under control.

Thanks in advance,

Posted Oct 4, 2017, 11:16 PM UTC

810
ssnepenthe•

So are you just looking for what can be done on the server without touching WordPress?

The easiest wins will be:

  • Ensure you are running PHP 7+. Performance improvement over 5.x is huge.
  • Install redis or memcached and an appropriate object cache dropin (e.g. https://github.com/pantheon-systems/wp-redis/). WordPress makes heavy use of its object cache, but by default it is basically an array store. With a backend like redis the cache can be persisted across requests and take a huge load off of the DB.
  • Switch to one of the mysql dropin replacements like mariadb. Supposedly performance is better. I have never tested this claim, however, so take it with a grain of salt.
  • Make sure PHP is tuned for the available resources (e.g. for PHP-FPM, https://serversforhackers.com/c/lemp-php-fpm-config).

If you are willing to dive into WordPress here are some tips for more performant WP code: https://10up.github.io/Engineering-Best-Practices/php/#performance.

The easiest win there will be caching via transients or the object cache. Ensure all remote requests and complex queries are being cached. If it seems appropriate, you might also consider some HTML fragment caching.

Also, there are a handful of core functions that are uncached (https://vip.wordpress.com/documentation/uncached-functions/). If your site uses any of those, consider wrapping them in some custom caching logic (some inspiration from WP.com VIP: https://vip-svn.wordpress.com/plugins/vip-do-not-include-on-wpcom/wpcom-caching.php).

Hope that gives you some ideas...

4
InsignificantOP•

Again, lots to go on here. Thanks very juch!

1
mil_dudeDeveloper•

This.

1
everythingisthrown•

#1 Caching is essential.

#2 You want HTTP2, TLS 1.3 (Cloudflare), browser caching, full page caching, object caching (can try APCu + wp-lcache), open file cache, opcache, PHP7+, Nginx, MariaDB 10.2, remove unnecessary plugins, keep 3rd party requests to a minimum, you can also try pre gzipping your files.

Also, check out roots/trellis.

3
InsignificantOP•

Lots to go on here, thanks!

2
mtxz•

What is full page caching? FastCGI cache style on server side you mean?

1
everythingisthrown•

Yes exactly

1
mtxz•

Do not forget build nginx with latest Google Pagespeed : really good improvement on :

  • asset JS/CSS (minification, combination...)
  • images (progressive, webp, spriting...)

Free Cloudflare offer is good also.

1
everythingisthrown•

I've always done that with build scripts, as I didn't really want to maintain a custom nginx build, but that is also an option.

1
mtxz•

Me too with gulp or yarn assets pipeline. You have more control on the project to implement something like this. But in a case of a WordPress, or a project from someone else, it's a easy way to get improvements without having to redo the entire pipeline.

1