If you enable munin_default module, munin_default_exit() will get called upon every webpage hit.

This function uses variable_set and variable set invalidates the variable cache. This means for every page hit, you'll be invalidating caches.

This will cause huge performance problems as it's much worse than simply doing an insert into a table each time...as the cache will then need to be rebuilt upon next page hit, and then it will get invalidated again. There's probably a bunch of queries that thus happen on every page load because of this.

Additionally, even if you're not using this statistic in munin it will get called every page load. User should at very least be able to disable it (should be disabled by default).

Storing the page load time is probably best done in APC user cache or some other form of non-database persistant caching. Even having munin create it's own cache and store this information via a cache_set would be best....as this could be abstracted into something like memcache.

But ya, it should be disabled by default as it currently works. If you have a large enough website where you needed to install munin to monitor performance, enabling this module will kill your performance.

Comments

Alex Savin’s picture

Yes indeed this could really be a performance drop. I will create it's own cache as you suggested as his I also think is the best idea. The Munin module shouldn't any kind of overhead to the whole Drupal system as this should be just a monitoring tool.

I'll check for more possible performance improvements.

Thanks!

Alex Savin’s picture

Status: Active » Fixed

Done!

I think that by using the caching functions improves the performance so (together with some other changes) I release a stable version for this branch. Please check it out and file issues.

j0rd’s picture

Thanks. Much appreciated for looking into this Alex. I'll install version 2.x when I have some time.

Alex Savin’s picture

Always happy to get some constructive criticism :). I'll close this issue for now. Please check it out when you have some time and open it again if needed.

Alex Savin’s picture

Status: Fixed » Closed (fixed)