This little line causes a server under load to start falling over... http://nathan.rambeck.org/blog/19-drupal-performance-and-variable-cache

variable_set('include_set_root', $done = TRUE);

thanks!

Comments

pillarsdotnet’s picture

Status: Active » Closed (works as designed)

This little line causes a server under load to start falling over... http://nathan.rambeck.org/blog/19-drupal-performance-and-variable-cache
variable_set('include_set_root', $done = TRUE);

That particular line occurs within the include_set_root() function, which gets called (at most) once per non-cached page request. If you bother to read the code, you'll notice that variable_set() is only called if variable_get() returns FALSE.

In other words, the variable is set (at most) once per Drupal installation, unless you uninstall and reinstall the include module. If setting a single persistent variable exactly once causes your server to fall over, you need to get a new server.

Closing this issue. If you still believe that using the Drupal API constitutes an "epic performance fail", I suggest that you start writing your web applications in C or C++.

Okay, I re-read my own code and see that variable_set is being called in the wrong place. Mea culpa; I'm now eating crow.

(fixing...)

pillarsdotnet’s picture

Title: #epic performance fail. » variable_set() should be called only when needed.
Assigned: Unassigned » pillarsdotnet
Status: Closed (works as designed) » Active

Changed in git; will roll new release shortly.

pillarsdotnet’s picture

Version: 6.x-1.7 » 6.x-1.8
Status: Active » Fixed

Fixed in 6.x-1.8 release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.