Incorporating Drupal's Throttle Module into Your Code

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

The content of this field is kept private and will not be shown publicly.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.