0

I enabled APC module and checked apc.php utility. It seems like uptime is very low. I refreshed many times and I saw maximum 1 minutes. It seems like caching doesn't work. How can I solve this ? Or do you recommend using another opcache ? (I prefer APC because CakePHP supports it)

I checked and found this question, but in that case litespeed is used. I don't use litespeed. This question doesn't have an accepted answer. Some similar question.

My system:
PHP 5.4.18
Centos 6.3
APC 3.1.13 PHP Server API: CGI/FastCGI
Server: Plesk 11.5

phpinfo is like this:

APC Support enabled
Version 3.1.13
APC Debugging   Disabled
MMAP Support    Enabled
MMAP File Mask  no value
Locking type    pthread read/write Locks
Serialization Support   php
Revision    $Revision: 327136 $
Build Date  Aug 8 2013 12:42:01

Directive   
apc.cache_by_default    On  
apc.canonicalize            On
apc.coredump_unmap          Off 
apc.enable_cli              Off 
apc.enabled                 On  
apc.file_md5                Off 
apc.file_update_protection  2
apc.filters                 no value 
apc.gc_ttl                  3600     
apc.include_once_override   Off  
apc.lazy_classes            Off  
apc.lazy_functions          Off  
apc.max_file_size           1M   
apc.mmap_file_mask          no value     
apc.num_files_hint          1000     
apc.preload_path            no value       
apc.report_autofilter       Off  
apc.rfc1867                 Off  
apc.rfc1867_freq            0    
apc.rfc1867_name            APC_UPLOAD_PROGRESS  
apc.rfc1867_prefix          upload_  
apc.rfc1867_ttl             3600     
apc.serializer              default  
apc.shm_segments            1    
apc.shm_size                32M  
apc.shm_strings_buffer      4M   
apc.slam_defense            On   
apc.stat                    On  
apc.stat_ctime              Off  
apc.ttl                     0    
apc.use_request_time        On   
apc.user_entries_hint       4096     
apc.user_ttl                0    
apc.write_lock              On  
Community
  • 1
  • 1
trante
  • 33,518
  • 47
  • 192
  • 272

1 Answers1

-1

The cause is mod_fcgid module. When you use fcgid, it spawns new PHP processes frequently. So same PHP process doesn't live too long. It dies after some time.

So caching is per-process. If you have 5 PHP processes you have 5 different caches. Each process uses its own cache. So it is not optimal to use modd_fgid + APC or any other opcode/opcache. But it can still help for performance.

trante
  • 33,518
  • 47
  • 192
  • 272