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
- 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?
- How to maintain wordpress site blogs in production and staging?
- Should I add sharing buttons using a plugin or directly in my theme files?
- Is there a way to measure server resource (CPU) usage by WP plugins?
- Under which circumstances is the .maintenance file not deleted?
- Editing Pages that Have Already Been Published
- Extra themes – ok or bad?
- Could a higher number of registered image sizes affect performance?
- Programatically switch page template?
- 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]
- Does loading of sub pages in menu cause load to the server?
- Checking for new message using AJAX and PHP. Server overload?
- WordPress takes too long to show 404 error on images (on LEMP stack)
- When to use wp_schedule_single_event for async / non-blocking processes?
- 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
- 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
- What are the best practices for maintaining and deploying several parent themes?
- I’m hiding site with index.htm but now I can’t get to index.php
- 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?
- 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
- Htaccess maintenance page rules that actually work with WordPress?
- Exclude Random Redirect from caching?
- Deleting expired session tokens in WordPress
- How can i find the cron jobs that run on my site and then move them to the server side?
- How to customize maintenance mode notification in wordpress?
- Best Way to Enter Maintenance Mode Programmatically
- Manage Admin permissions by URL GET parameters
- Change role in maintenance mode
- How to programmatically put wordpress in maintenance mode
- Enable a Coming Soon Page while the rest of the site is accessible
- Briefly unavailable for scheduled maintenance. Check back in a minute. This message is shown to subscriber and general user
- Server peek by Own-IP-Calls?
- A SINGLE Post Giving an “Under Maintenance” Message
- Limit Search Queries per IP per Day
- Why my site scroll top when end load pages
- How to update plugins in a distributed wordpress scenario?
- Allow the access over wp-login.php
- Incomplete attachment page
- How to optimize ‘select found_rows()’ query? Several ‘high load average’ alerts daily
- How can I let users open the site for other visitors?
- Automatically load WordPress page on server every XX hours
- Would Amazon AWS Services be a good alternative to my current hosting provider?
- Making an under maintenance page (without using plugins)
- WordPress article with 50 000 words loading slow – 100% cpu
- My wordpress website admin panel loads very slow, what can i do about that? [closed]
- Could a very long article slow down all website and wpadmin?