Bad performance when submitting content

Pretty sure I've tracked this down:

By default, Drupal clears all block and page cache when submitting a node or comment. So this means as soon as the comment is submitted, both caches have to be rebuilt at once for both blocks and pages - we have some expensive blocks which are usually cached for 90% of page views, but these all have to be built again at the same time, so for about a minute or two, the server gets hammered.

I've temporarily removed the cache clearing from comment and node submission (but not deletion yet - if you want to delete a bunch of nodes or comments, easier to unpublish them first, then delete them in bulk from the content and/or comment admin screens) and this seems to have fixed it for now. It's not a real fix, but it's an effective one.

Needs work
bug report

Posted By

Mike Harman
Sep 23 2009 16:02


Attached files


Mike Harman
Sep 23 2009 16:10

This isn't the only reason the site is slowing down by the way, but it's definitely one of them.

Sep 23 2009 17:50

The site also grinds to a halt when you delete or edit content.

Nov 1 2009 17:44

This seems better now, did you do something the other day?

One thing I thought might make the site a bit quicker is I notice if you click "back" then it reloads the page - couldn't we set the site so that if you go back it just shows you the cached page? Or is that a browser setting, not a website setting?

Mike Harman
Nov 2 2009 04:41

I have the tracker query cached for 5 minutes (but not whether it shows new comments on threads already in the cache) - this is one of the main slow queries on the site, and it touches the same database tables which get hit when you add / update / delete content - I think what was happening, is those tables get locked when you do an update, then tracker gets hit by people and the requests get backed up. More to do, but this was a quick win.

Back button - I thought this was fixed in D6, but will look into it.

Nov 2 2009 10:14

Cool, nice one mate.

May 7 2011 14:41

The main problem with performance was the in moderation queue box. Can we mark this as properly fixed now?