It's a high traffic website, but I guess high load is not because of traffic because many times it runs smooth on same traffic. I researched a lot and optimized Apache, switched off logging modules to save resources and done whatever may be cause of load. Then finally I installed devel on site and check using "Collect query info", "Display query log" and I found that this particular query taking too much time (more than 2000 ms)

UPDATE cache SET data = 'a:2:{s:7:\"profile\";a:36545:{s:32:\"c21f969b5f03d33d43e04f8f136e7682\";a:17:{s:6:\"layout\";s:7:\"default\";s:14:\"layout_desktop\";s:7:\"default\";s:15:\"layout_handheld\";s:2:\"-1\";s:13:\"layout_iphone\";s:2:\"-1\";s:4:\"menu\";s:13:\"primary-links\";s:10:\"menu_style\";s:4:\"mega\";s:11:\"option_font\";s:1:\"0\";s:14:\"option_layouts\";s:1:\"0\";s:11:\"option_menu\";s:1:\"0\";s:13:\"option_screen\";s:1:\"1\";s:13:\"option_t3logo\";s:1:\"1\";s..........................................................

and page getting loaded and loaded to infinite time, it never completes. I am sure this is the only reason for high load on server.

APC is already installed on my seerver.

  • High load website and DB cache is a bad bad idea. Why not APC, Memcached or any other in-memory caching? – Mołot Jan 30 '14 at 7:31
  • I suggest you optimize Mysql and also use APC php plugin for Apache. – AgA Jan 30 '14 at 7:36
  • Hello Molot, thanks for quick reply. but APC is already installed. Its the only query creating problem and also I am using Boost for caching. – Tonu Jan 30 '14 at 7:36
  • @user2446908 nice. So why you refuse to use it for cache? Also, add @ in front of my name if you want me to be notified about your comments – Mołot Jan 30 '14 at 7:40
  • thanks @Mołot for the tip, I am quite new. Please explain "why you refuse to use it for cache", how can I add it to cache – Tonu Jan 30 '14 at 7:48

Given your server already has APC installed, you do not need to keep cache in database at all. And probably shouldn't.

Install APC module (for older Drupal versions see Cacherouter or Cache Backport) to move your cache from MySQL to RAM. Without it, APC only caches opcode, not Drupal's cache data. Also, APC Status or APC Admin module helps with monitoring.

It might be wise to exclude form cache from APC and keep it in database, but that's material for another question.

For APC optimization, see this question.

  • thanks. but APC is not available for D6 should I install cache_backport module. And after installing this should I disable drupal core cache and aggregate css & js options. – Tonu Jan 30 '14 at 8:07
  • @user2446908 No, after installing it keep Drupal's setting as they were. It will simply move Drupal's cache to a more efficient place, so do not disable it :) – Mołot Jan 30 '14 at 8:20
  • should I install cache_backport for D6? – Tonu Jan 30 '14 at 9:12
  • 1
    Sorry but I don't see how anyone could help you any further here - the answer is simply that your site is trying to cache too much at once. Why exactly that might be depends on literally dozens of different, potentially complicated, factors. These factors could be your Drupal site, the modules installed, your server config, DBMS config, how much memory you've got, how much hard drive space is available, and on and on and on. If you've got to the end of your debugging abilities, it's time to get a Drupal contractor involved. – Clive Jan 30 '14 at 11:25
  • 1
    Either way, I'm afraid we can't continue to allow you to use the comments here like a support ticket. It goes against the very ethos of this site, and it's not fair on other users. I understand you have an issue you need to get resolved, but I'm afraid this isn't the right place for this particular issue. Please see the help center for more information on what we do here. Thanks – Clive Jan 30 '14 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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