Twitter and other high-volume sites probably do this one layer ahead of the servers. Probably with a load balancer that can detect the server load over all servers and if the load is too high (when machines stop replying) they redirect traffic to a server that returns only the “fail whale” page.
This answer on Stack Overflow suggests to look at sys_getloadavg()
and display an error when it is too high (and “too high” should be defined by trial and error). I would do this in the main index.php
file that “boots” WordPress, to get a quick exit and not put more load on the server.
Related Posts:
- Profiling a WordPress Website for Deployment on Shared Hosting?
- Many POST requests to /xmlrpc.php from GoogleBot taking down server?
- What is the expected limit for acceptable performance of WordPress without any adjustments?
- Loading scripts on specific page
- Too many MySQL connections on WordPress
- Load testing for WordPress functionality
- Large Number of WordPress Posts
- Getting two versions of CSS
- Why does my site flash white every time it changes page? [closed]
- Load-Testing a WordPress Site
- Internal Server Error and bad CSS
- Does having multiple random posts add up to server load and page load times?
- WordPress very high load when click “Publish”
- how to restore a wordpress website, when hosting has got expired but the hosting company gives you a bunches of zip file?
- is .maintenance file still valid for putting WP in maintenance mode?
- Are WordPress Heartbeat API ‘beats’ staggered or do they occur simultaneously for all users?
- Redirect Visitors to a Temporary Maintenance Page
- Redirect entire website to a single page
- Restricting a Plugin to Only Load its CSS and JS on Selected Pages?
- Custom maintenance page
- Changing the WP CLI cache folder
- How to Layer 7 Load Balance WordPress Backend and Frontend?
- Are there server performance benefits to fetching only specific fields when querying the REST API?
- Update, add, remove plugins, themes or wordpress behind load balancer
- .maintenance and maintenance.php also in multisite install?
- Is there a maintenance mode in WordPress core?
- How can I easily verify a core or plugin update has not broken anything?
- Site Stuck in Maintenance Mode
- Stress testing WordPress
- Is it safe to delete from db orphaned posts i.e. whose post_parent no longer exists?
- Is it good practice to remove redundant plugins and themes?
- What are best practices for configuring a server for WordPress sites?
- Using Global Variables Expensive for PHP
- High CPU & Memory Spikes?
- How do I add indexes to WordPress Database?
- How to maintain wordpress site blogs in production and staging?
- Should I add sharing buttons using a plugin or directly in my theme files?
- Can plugins become obsolete?
- Is there a way to measure server resource (CPU) usage by WP plugins?
- Under which circumstances is the .maintenance file not deleted?
- Is it possible to us WP Core Maintenance Mode for short pause while a plugin runs?
- Editing Pages that Have Already Been Published
- Extra themes – ok or bad?
- Could a higher number of registered image sizes affect performance?
- Too many posts cause slow load when paginating
- Programatically switch page template?
- Mysql / WordPress killing my server with 80k users [closed]
- Is it possible to cache ?wc-ajax=get_variation
- How can I measure the performance of any WordPress Plugin or Theme?
- How to limit WordPress pages during updates?
- Meta_query with relation ‘OR’ killing server CPU
- wp_redirection_404 table has grown to 7GB
- The site is experiencing technical difficulties. Please check your site admin email inbox for instructions
- Possible to stay on Version 4?
- Can I update themes without enabling maintenance mode?
- How to Better Control WordPress Cron Jobs?
- What is the best way to count and display the number of posts?
- server load. $_SERVER[‘REMOTE_ADDR’] and $_SERVER[‘HTTP_HOST’] [closed]
- Editing post and page responding 503 Service Unavailable
- Does loading of sub pages in menu cause load to the server?
- Plugin upgrade issue
- Checking for new message using AJAX and PHP. Server overload?
- WordPress takes too long to show 404 error on images (on LEMP stack)
- Stuck on maintenance mode
- When to use wp_schedule_single_event for async / non-blocking processes?
- Site running slow on new server?
- What’s the best way to implement AJAX in WordPress?
- How to Display Frontend CSS for Administrator only
- Handling large N data in WordPress
- image in my post disappeared after I upload website to remote server
- Does using WP-cron make the site slower for the user?
- Setting maintenance mode via REST API
- What is calling this parallax-slider.less file that is missing? [closed]
- Organize WordPress site, so it can maintain with huge database
- Site not responding error – taking long to load [closed]
- WordPress and WooCommerce – How many products are too many? [closed]
- Why would a WordPress site go into maintenance mode without me doing anything?
- How much maintenance is required to run a WordPress server?
- How effective are cacheing plugins for dynamic pages?
- How to handle support for a non-technical client [closed]
- What is a reasonable memory limit for WordPress
- How can I permanently cache or “archive” a WP blog without needing future maintenance
- How to do big modifications to live site?
- What are the best practices for maintaining and deploying several parent themes?
- High CPU load when loading images in media library
- I’m hiding site with index.htm but now I can’t get to index.php
- High traffic management in WP
- How to see which sites use my installed plugins (wordpress multisite)
- I have a snippet to redirect all users to a maintenance page. How do I exclude users with admin role?
- Should I store critical css in the database or in my theme’s filesystem?
- Server technical information and first respond time for WordPress
- How can I add a title to this ‘maintenance mode’ function?
- WordPress website keeps loading the maintenance page
- Disable Garbage Collection? [closed]
- What will be the best caching system for wordpress blog which has more than one million blog posts? [closed]
- How much resources are good enough for 3.9.2
- Custom Maintenance Page
- How to reduce Apache connections caused by plugins?
- Htaccess maintenance page rules that actually work with WordPress?
- Exclude Random Redirect from caching?