欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Best APC settings to reduce page execution time 有大用

shiping1 的头像
正确答案

 
12down voteaccepted

We run in a SVN push environment so we only clear the apc file cache with a script.

APC settings:

apc.ttl=604800
apc.user_ttl=3600
apc.shm_size=192M
apc.include_once_override=1
auto_globals_jit=Off
apc.num_files_hint = 2048

apc.stat_ctime = 0
apc.file_update_protection = 2
apc.stat = 0

PHP Script:

<?php
$return = apc_clear_cache('opcode');
echo var_export($return);

604800 = 1 week.

After this, getting xdebug/xhprof up and running and doing a cache grind of the site should let you know what's slowing down the site. In short analyzing the cache grind output is the best way to speed up Drupal. Below I'm listing what patches and modules we use to speed it up; in your case it will be different most likely.

Drupal 6 Specific Answer Below

Once you get past this point and realize the APC isn't going to give you what your looking for, switch to pressflow and give these patches a whirl:

Also try some of these modules as they improved our sites speed in a big way:

shareimprove this answer
 
   
Thanks a lot for your answer, but I have Drupal 7. – john Oct 5 '11 at 10:57
   
So take the APC parts and the xdebug/xhprof parts and look at the D6 patches as an example of what to look for in the d.o issue queue. All of the above patches where a result of looking at the cache grind, finding the pain point and finding the corresponding issue for it. Quick start: drupal.org/project/issues/search/… – mikeytown2 Oct 5 '11 at 17:22
   
There is a drupal 7 performance wiki now: groups.drupal.org/node/210683 – mikeytown2 Sep 11 '12 at 4:03
1 
Just FYI, I had to comment the line apc.include_once_override=1 because broke the sitepuregin.org/node/2550/3928 – corbacho Nov 16 '12 at 20:12
   
php.net/apc.configuration#ini.apc.include-once-override Thanks for pointing that out. Depending on the PHP and APC version it might cause problems – mikeytown2 Nov 16 '12 at 22:19

普通分类: