Tag1 Consulting

Performance and Scalability Experts

NFS, Drupal And The Realpath Cache

Comments

Its a very useful

Submitted by Anonymous on Wed, 04/22/2009 - 02:57.

Its a very useful information Thanks for sharing.Good job.

opcode cache?

Submitted by Anonymous on Fri, 04/17/2009 - 16:43.

Just curious, are you using an opcode cache? I recently discovered something similar with APC.

Setting apc.stat = 0 disabled stat checking entirely, which made huge performance difference. As long as you set the cache size to a large enough value, the filesystem is almost never touched (I found 64M is about right for a complex Drupal site).

APC and include_once

Submitted by nnewton on Fri, 04/17/2009 - 16:54.

Actually, someone else just mentioned this to me as well. Yes, we do use APC and something like it or eaccel is absolutely required for a performance-oriented drupal site. However, there is a problem with the stat setting and the include_once_override setting (which APC has developed specifically at this problem). You can see a description of what these settings do here: http://t3.dotgnu.info/blog/php/include_once-mostly-harmless.html

To summarize, APC tries to rewrite the include_once lines to be full path includes and get around this problem. However, Drupal uses dynamic includes and as such APC cannot know at compile time what to rewrite the includes to, so it cannot optimize drupal's include_once calls. The stat setting does help, but in our testing doesn't really prevent the problem and lstat is still far and away the biggest problem with APC's optimizations turned on.

Drupal 7 will fix this

Submitted by Anonymous on Sat, 04/18/2009 - 23:58.

Drupal 7 will fix this, because it defines a DRUPAL_ROOT in index.php and sets it to getcwd(). It then uses this to prefix all the include_once/require_once.

So, that will help.

Another APC configuration parameter that is promising, is apc.include_once_override. If you can measure that too, that would be awesome! ;-)

D7

Submitted by nnewton on Mon, 04/20/2009 - 12:35.

Yes, d7 should help a lot with this. I was actually talking about the include_once override in the post above yours. For various reasons (dyn includes), Drupal doesn't benefit from it at all :(. Was disapointing to discover.