0

Recently, I have selected "Normal" (recommended for production sites, no side effects) of the Caching mode at admin/settings/performance; I can see the CPU usage is drop from 60-70 to 6-8 by accessing the Drupal site on the same PC. However, when I use another PC to access the Drupal site, the CPU usage is risen to 60-70 again. So is there any mis-configure on my Drupal site?

  • 2
    Did you visit the same page? Did you log in? – jcisio Jan 31 '12 at 7:09
1

Drupal generates cache when a node, block, or view is rendered the first time. How much cache is served versus how much is generated on that request can depend on both that visitor's role and specific user account.

If two anonymous users hit the same page, the first anonymous user will trigger the cache to be generated for elements on that page, then the second anonymous user will receive those cached elements and the page will load faster for them.

However, if one authenticated user hits a page, then an anonymous user hits the same page, two different versions of a selection of elements on that page will be cached (for instance, if authenticated users are allowed to see a block, but anonymous users aren't).

Therefore, Drupal's caching mechanism works best when there are lots of visitors with the same permissions hitting the same non-personalized pages. If it's a site with users who sign in, and there are lots of permissions (especially field-level permissions) at play, Drupal's cache will be fairly ineffective for anything but static content nodes and blocks.

  • Yes, I use several anonymous user to access my Drupal site, and found that the CPU is high for each access. So your mention Drupal's caching mechanism works best when there are lots of visitors with the same permissions hitting the same non-personalized pages is not true in my suitation. Is it something wrong on my site, such as server setting or Drupal configure? – Charles Yeung Feb 1 '12 at 12:06
  • I'd grab the devel module and turn on SQL Query logging and see if you can identify any slow queries. Also you'll be able to tell whether or not Drupal is asking for cache, or retrieving full page requests – jmking Feb 1 '12 at 23:32
  • @CharlesYeung you might want to take a look at which process consumes the resource using top command...there's a possibility that this might not be related to caching completely and might be related with the type of apache server and its settings or a bad query which could be checked with devel module as suggested by the previous comment – optimusprime619 Apr 30 '12 at 6:49

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.