You are here

Minimize logged in users on your Drupal website to reduce load on your server

If you have lots of authenticated users, then you probably know that most of Drupal's caching is pretty much thrown out the window for logged in users. By default, when a user logs in, the user will stay logged in for 200000 seconds (that's just over 3 weeks!)

That equals 23 days that your Drupal website is probably working its ass off serving mostly dynamically generated pages. Instead, Drupal could simply be grabbing the page out of the page cache and handing it to an anonymous session whilst sipping margaritas in its spare time. (That's what I'd be doing with free cycles anyways.)

There's a cheap trick in Drupal 6 and 7 to reduce the number of authenticated users thereby reducing the load on your server. In the settings.php file (located in the /sites/default folder), there is a setting called session.cookie_lifetime. Change this to something a little more draconian such as 7200 (2 hours); enough time to post a comment or whatever and logout (or be forcibly logged out).

Obviously, this won't be practical for lots of sites but for some sites it can make a huge difference.

Happy Drupaling!