Each uncached page request for your website is handled by a PHP Worker. You can think of these PHP Workers as employees along an assembly line. Each worker labors to execute the PHP code that makes up your website’s pages as requests come in. Because of WP Engine’s proprietary multi-tiered Evercache® system, many page requests are served from cache before even having to be handled by a PHP Worker. But what happens when too many uncached requests come in at once? In this article we explain the unique way WP Engine handles request prioritization in the condition where there is too much uncached traffic for the PHP Workers to handle.
Intelligent traffic shaping
Where most hosts simply serve traffic on a “first come, first served” basis, WP Engine understands that your site needs to reach real users first. With WP Engine, a unique traffic shaping system prioritizes real users above requests from bots, crawlers, and AJAX requests. That means your site will always serve real users first (even if your site is being crawled by Google and sending many uncached requests).
The other dilemma other hosts present is that when a server is barraged with uncached traffic, it simply begins denying all new requests. On WP Engine our system intelligently chooses oldest waiting requests to be rejected. This allows your site to still accept new traffic in the process. That means instead of high traffic simply taking your site down, your site can still support new traffic continuously through it all.
Efficiency in separate queues
WP Engine sorts traffic into several queues. The first degree of separation is by account. So when one account on a shared environment is getting overwhelmed with traffic, other sites still have their fair share of PHP Workers available to serve their own requests. This way, no one gets more than their fair share of server resources.
The second degree of separation comes in the type, and source of requests. AJAX and XMLRPC requests are grouped together into their own lower-priority queues because they are not quite as important actual page requests (and are often abused). And, requests from well-known bots are grouped into another lower-priority queue. That means the server will get to bot requests only after it has served the real users on your site. This queueing system allows the web server to simply serve the requests as they come in if it can. And if it can’t, it will prioritize the true end users of your website above others.
Best practices for optimal request queueing
Our request prioritization and traffic shaping system does a lot of work to protect your site. However, there are some known plugins to steer away from. The following plugins tend to overwhelm your PHP Workers:
- View/Share counter plugins
- Plugins that generate popups
- Ad plugins which hit admin-ajax.php
These types of plugins tend to trigger large amounts of uncached traffic to your site. This is compounded when your site is already receiving heavy traffic. If possible, we recommend using any caching settings available for these types of plugins, or avoiding their use altogether. This will help ensure your site can scale to better support higher traffic.