Bobcares

Top 7 server optimization tips for WordPress performance tuning

by | Aug 28, 2015

Everyone loves a fast website. Even search engines such as Google say a site should respond within 200 milliseconds [1]. This means you should keep your site lightning fast not just to keep your customers happy, but to retain your SEO rankings.

From image optimization to web server tuning, a lot goes on behind performance tuning a WordPress site. Here at Bobcares, we help website owners, web designers and web hosts optimize their WordPress sites and WordPress servers.

See how we speed up WordPress websites!

We monitor WordPress servers 24/7, quickly fix performance issues if we detect any, and periodically optimize the web and database servers.

In a previous post we covered website specific optimization tips such as plugin optimization and CSS/JS minification. Today we’ll cover the server optimization part of WordPress performance tuning.

Here are the WordPress server optimization steps included in our Server Management Services, that we’ve seen to be effective.

1. Get browsers to cache your site files

WordPress pages load many CSS, JavaScript and image files. Almost 80% of these files are downloaded again when the visitor returns to your site again at a later point of time, resulting in a long page load time.

By asking browsers to cache your website files, you can get visitors to load your site pages really fast. In NginX, this is done using the “Expires” tag, and in Apache, this is done using “mod_expires”.

However, take care when you use these directives. The look and functionality of your site depends on CSS and JS files, and if these kinds of files are cached for a long time (eg. 30 days), your repeat customers might not notice a theme or feature change in your site.

At Bobcares, we help WordPress site owners take advantage of browser caching, but avoid common pitfalls by custom configuring expires directives.

2. Compress site files for faster download

A vast majority of the files in a WordPress site are text files such as CSS, JS and HTML. These files can be compressed to one-tenth of its size, thereby reducing site load speed.

In Apache, this can be done using the mod_gzip module, and in NginX it can be done using the “gzip” tag.  It is important to note that while compression improves page speed, it can induce considerable CPU load, thereby slowing the server.

We help WordPress site owners strike a balance between compression and resource usage. In some cases, we’ve used statically compressed files, and caching web servers to reduce CPU load while ensuring high compression rates.

[ Want to speed up your WordPress sites for better performance? Our website technicians will audit and fix your websites in no time. ]  

3. Optimize the database

WordPress stores all it’s contents in the database, and for each page load, several database queries are executed. Over time, issues like fragmentation, growth in table size, etc. lead to poor database performance.

So, it is vitally important to optimize the database every once in a while. At Bobcares, we detect database bottlenecks early, and fix them before it can slow down the website.

Our server experts monitor database metrics such as query latency, slow queries, memory usage, etc. in our customer servers to detect performance issues.

Here are a few settings we tweak often in MySQL servers to keep up the server speed:

  • max_connections – In multi-user servers, this setting is used to prevent a single user hogging the entire server. In heavily loaded shared servers, this limit can be as low as 10, and in dedicated servers, it can be as high as 250.
  • innodb_buffer_pool_size – In MySQL databases enabled with InnoDB, query results are stored in a memory area called “buffer pool” for fast access. We set this value anywhere between 50-70% of available RAM for MySQL.
  • key_buffer_size – This setting determines the cache size for MYISAM tables. This is set approximately at 20% of available memory of MySQL.
  • query_cache_size – This is enabled only for single website servers, and is set to 10MB or less depending on how slow the queries are at present.

4. Get a fast PHP engine

Not all PHP engines are created equal. Older PHP engines such as mod_PHP and suPHP are inefficient in their code execution. There are modern replacements such as PHP-FPM, HHVM and PHP 7 that can give an instant speed boost to your scripts.

However, running these engines can be tricky. We manage both Apache and NginX servers for our customers that have fast PHP engines. Here are a few common issues we faced:

  1. Setup challenges – These engines run as a separate service, and Apache (or NginX) should be configured to pass on all PHP files to the engine. In addition, the permissions on service sockets and PHP files should be set right.
  2. Maintenance issues – High performance engines use internal caching to compile PHP faster. Based on changes in site traffic and website code, these settings need to be adjusted periodically to make sure stale content is not served, or caching is under-utilized.

5. Cache PHP execution results

Many websites these days run on PHP, or other scripting languages. When a visitor requests a page, the server expends CPU, Memory and Disk I/O to build an HTML page out of several PHP files.

There’s no reason why a second request for the same page should take so much resources. PHP OpCode cache systems such as APC or X-Cache stores executed PHP code in memory, so that next time resources need not be spent to process the PHP code again.

However, poorly implemented or un-maintained opCode caches can take a toll on website performance. Some PHP engines such as suPHP cannot cache PHP files, and enabling high compression on caches can induce high server load.

Bobcares helps WordPress site owners setup and maintain effective PHP cache systems. We periodically audit the performance of cache systems, and adjust the server settings to prevent build-up of stale data, and to prevent over-use of server resources.

[ Optimize your WordPress sites for better experience! Our server technicians will audit and fix your websites at affordable pricing. ]

6. Bypass PHP engine by caching HTML pages

If there’s something better than a PHP cache, it is an HTML cache. All WordPress web pages are sent out as HTML files, and a majority of visits can be satisfied with a pre-generated HTML page.

There are several HTML cache systems that work with PHP. One that we like is Varnish. Varnish keeps all recurring file requests (such as images, files, etc.) in the RAM so that system resources need not be used unless there’s a NEW page request.

All that being said, Varnish systems sometimes face 503 errors, resource limits, etc. and could prove hard to fix. To resolve such issues Bobcares monitors customer websites 24/7 and as soon as we detect an anomaly, we login to the server and fix the issue before it’s noticed by site visitors.

7. Use HTTP/2 instead of HTTP 1.1

A vast majority of websites use HTTP protocol v1.1. This is an old version released in 1997 that forces browsers to download files for a page sequentially one after another.

A new version of HTTP, that is HTTP/2 was released in 2015, and is supported by all major browsers and web servers. It provides many speed boosting features such as multi-file transfer per connection, compressed headers, etc.

As with everything nice, adopting HTTP/2 comes with a couple of caveats:

  1. Convert the site to HTTPS – Major browsers like Chrome and Firefox support HTTP/2 only over fully encrypted HTTPS connections. Converting the whole site to HTTPS can get tedious. In our customer sites, we had to replace http links with https, setup auto-renewable SSL, and test all functions until we could release it to production.
  2. Monitor for vulnerabilities –  HTTP/2 is still new. While the protocol itself is strong, there could be vulnerabilities in the server code. So, it is important to keep a close eye on security news, and patch the server if there’s an issue. In Aug 2016, 4 HTTP/2 vulnerabilities were disclosed, which we were able to patch in customer servers within 24 hours.

Conclusion

The performance of your WordPress website depends a lot on your choice of plugins, themes and the way you use media in your website, but optimizing the underlying server is equally important.

Today we’ve covered a few steps we’ve found to be effective in our WordPress server management services. If you’d like to know how our services can make a difference to your site, we’d be happy to talk to you.

 

OPTIMIZE YOUR WORDPRESS SITES TODAY!

Never again lose customers to poor page speed! Let us help you.

We keep your servers optimized, secured and updated at all times. Our engineers monitor your applications 24/7 and fix issues before it can affect your customers.

CLICK HERE FOR A FAST WEBSITE

var google_conversion_label = "Blp0CLCojHIQ0aD71QM";

0 Comments

Never again lose customers to poor
server speed! Let us help you.