有一台新的服务器,主机为我安装了APC。
重载apc.php表明ACP每4-6秒重置一次。 正常运行时间总是为零,命中率从不超过3000。
该网站运行平稳,但如果APC真的重新开始,我想解决这个问题。
error_log不显示错误。 我唯一能find的就是运行一些PHP脚本的cronjob错误PHP Warning: Module 'apc' already loaded in Unknown on line 0 。
眼镜:
Ubuntu 12.04.4 LTS SSD harddrive Apache/2.2.22 (Ubuntu) DAV/2 mod_fcgid/2.3.9 mod_python/3.3.1 PHP 5.3.10-1ubuntu3.11 with Suhosin-Patch (cli) APC Version 3.1.7
apc.php快照:
Shared Memory 1 Segment(s) with 200.0 MBytes (mmap memory, pthread mutex Locks locking) Start Time 31.05.2014 14:39:51 Uptime 0 minutes File Upload Support 1 File Cache Information Cached Files 161 (24.4 MBytes) Hits 2423 Misses 161 Request Rate (hits, misses) 136.00 cache requests/second Hit Rate 127.53 cache requests/second Miss Rate 8.47 cache requests/second Insert Rate 8.58 cache requests/second Cache full count 0 User Cache Information Cached Variables 0 (0.0 Bytes) Hits 0 Misses 0 Request Rate (hits, misses) 0.00 cache requests/second Hit Rate 0.00 cache requests/second Miss Rate 0.00 cache requests/second Insert Rate 0.00 cache requests/second Cache full count 0 Runtime Settings apc.cache_by_default 1 apc.canonicalize 1 apc.coredump_unmap 0 apc.enable_cli 0 apc.enabled 1 apc.file_md5 0 apc.file_update_protection 2 apc.filters [path to my apc.php] apc.gc_ttl 3600 apc.include_once_override 0 apc.lazy_classes 0 apc.lazy_functions 0 apc.max_file_size 2M apc.mmap_file_mask apc.num_files_hint 7000 apc.preload_path apc.report_autofilter 0 apc.rfc1867 0 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 200M apc.slam_defense 1 apc.stat 0 apc.stat_ctime 0 apc.ttl 7200 apc.use_request_time 1 apc.user_entries_hint 4096 apc.user_ttl 7200 apc.write_lock 1
问题是mod_fcgid
阅读其手册页面: http : //httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
不可能共享操作码caching,这就是为什么你看到不同的caching,当apc被刷新… suPHP也是邪恶的。
使用mod_fastcgi和php-fpm
ps一些apcconfiguration需要设置apc.enable_opcode_cache = 1