Incorporating Drupal's Throttle Module into Your Code
Submitted by kevin on Wed, 05/14/2008 - 04:10
in
To make your code safer to run on servers with high load conditions, you should prioritize its functionality into two categories: mission critical and non-critical. The Throttle module allows you to test the current server load conditions using the following code snippet:
$is_throttled = module_invoke('throttle', 'status');
if (!$is_throttled) {
// the site is not being throttled
// execute non-critical functionality
}This way you can lessen the server's burden when traffic spikes, conserving valuable resources for your customers.


Post new comment