I am building an intranet site. I have the site set up with single sign on via the server authentication module meaning there are no anonymous users. This means large parts of the cache are worthless.

The site is now set up how I want, however it's running extremely slowly for the first couple of page loads if the site hasn't been visited in a couple of hours. The speed picks backup once you've looked at a couple of pages.

We now have cron set up running every two hours with a scheduled task, so I now know cron isn't slowing the site down. I have the Devel module enabled, and some of the queries are clearly slowing things down and a lot of these seem to be cache related.

Below are all of the queries ran that took over 100ms when I visited the site's home page first thing this morning. (Speed in ms followed by task)

421.91 system_list
890.69 DrupalDatabaseCache::set
171.89 DrupalDatabaseCache::getMultiple
125.01 DrupalDatabaseCache::getMultiple
125.01 PagerDefault::execute
125.01 DrupalDatabaseCache::getMultiple
109.38 comment_num_new
390.65 DrupalDatabaseCache::getMultiple
140.64 ctools_export_load_object
187.51 DrupalDatabaseCache::set
328.15 DrupalDatabaseCache::getMultiple
421.91 admin_menu_tree_dynamic
390.65 admin_menu_tree_dynamic
1000.07 DrupalDatabaseCache::getMultiple
421.91 DrupalDatabaseCache::getMultiple
578.17 DrupalDatabaseCache::set
281.27 menu_get_item
343.77 statistics_exit
140.64 _drupal_session_write

Clearly there's enough here to slow the site down. However truth be told I don't have much of a clue how to a) decode what all the above really mean and b) what to do about any of it.

I would be grateful for any advice or pointing in the right direction anyone can give me.

  • What cache mechanisms you already have in place (e.g. APC)? Did you perform some general optimizations to make pages load faster (e.g. remove unnecessary modules, cache views output, blocks, etc.)? Jun 11, 2014 at 8:36
  • Other than altering the settings on the Performance admin page (admin/configuration/development/performance) I haven't done any customization to cache. I can't cache blocks as this has been disabled by content access restricting modules (probably field permissions module). Thanks for responding.
    – gdhp
    Jun 11, 2014 at 8:41
  • In a production environment you should probably switch off devel modules. Check if database logging is switched on: that slows things down, too. Installing APC and memcache would speed up caching, if you can install them on the server.
    – Ollie
    Jun 11, 2014 at 9:17
  • Thanks. The site is hosted on our own internal server. So shouldn't be a problem installing memcache & APC. The server is IIS 7, but I'm hoping that won't get in the way.
    – gdhp
    Jun 11, 2014 at 9:36

2 Answers 2


I created a presentation that covers some of the basics of of performance https://docs.google.com/presentation/d/1AgnurTWsWdMAFjfFmSU7mk2zfJu8jG_KmVdZ7-o6Pok/edit#slide=id. In your case I would make sure poormans cron in core is disabled, use an IP for your database connection (very important on IIS), make sure you have some sort of op code caching enabled, and follow this guide (linked in the presentation under Basic database tuning) to fix database issues at the drupal level, and be sure to adjust some MySQL defaults as well.


Also check out mySQL optimisation. Here's a couple links to get you started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.