APC与PHP5-FPM和Nginx结合使用时非常奇怪

时间:2013-05-29 14:29:44

标签: php caching nginx apc

我已经在我的Ubuntu 13.04服务器盒上运行了APC已经有一段时间了。几天前,有些地方出了问题,现在它表现得非常奇怪。我会把它解决。

我的PHP配置文件位于/etc/php5/mods-available。 PHP5的所有配置目录(/etc/php5/cli/conf.d/etc/php5/fpm/conf.d等)都符号链接到/etc/php5/conf.d/,而/etc/php5/mods-available符号链接到php -i。如果我从shell运行/etc/php5/cli/conf.d/*,我会返回apc APC Support => disabled Version => 3.1.13 APC Debugging => Disabled MMAP Support => Enabled MMAP File Mask => /tmp/apc.XXXXXX Locking type => pthread mutex Locks Serialization Support => broken Revision => $Revision: 327136 $ Build Date => Oct 9 2012 20:29:11 Directive => Local Value => Master Value apc.cache_by_default => On => On apc.canonicalize => On => On apc.coredump_unmap => Off => Off apc.enable_cli => Off => Off apc.enabled => On => On apc.file_md5 => Off => Off apc.file_update_protection => 2 => 2 apc.filters => no value => no value apc.gc_ttl => 3600 => 3600 apc.include_once_override => Off => Off apc.lazy_classes => Off => Off apc.lazy_functions => Off => Off apc.max_file_size => 1M => 1M apc.mmap_file_mask => /tmp/apc.XXXXXX => /tmp/apc.XXXXXX apc.num_files_hint => 512 => 512 apc.preload_path => no value => no value apc.report_autofilter => Off => Off apc.rfc1867 => Off => Off apc.rfc1867_freq => 0 => 0 apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS apc.rfc1867_prefix => upload_ => upload_ apc.rfc1867_ttl => 3600 => 3600 apc.serializer => default => default apc.shm_segments => 1 => 1 apc.shm_size => 128M => 128M apc.shm_strings_buffer => 4M => 4M apc.slam_defense => On => On apc.stat => On => On apc.stat_ctime => Off => Off apc.ttl => 3600 => 3600 apc.use_request_time => On => On apc.user_entries_hint => 4096 => 4096 apc.user_ttl => 7200 => 7200 apc.write_lock => On => On 的配置文件,这应该与配置文件完全相同。我的问题的相关部分是:

apc.enabled

这会将选项/etc/php5/fpm/conf.d显示为开启。但是,我的phpinfo.php(上面的链接)显示了PHP5-FPM的配置(来自apc.enabled),将此选项显示为Off。事实上,php(cli)的命令行版本和我的webserver(fpm)上运行的版本使用完全相同的符号链接配置文件。

我的APC似乎是缓存,但它表现得很奇怪。在我清空缓存并在我的服务器上的Wordpress安装上重新加载一些页面之前,我会看到页面立即被缓存。现在,它几个小时都停留在相同的Hits和Misses数字上,我可以尽可能多地刷新,没有任何变化。

0选项在apc.php上显示为20-apc.ini(关闭),但它似乎至少在做某事。操作码缓存和用户缓存中都有文件。它表现得很奇怪,我从PHP返回了很多矛盾的设置。我在这里不知所措。这是extension=apc.so apc.enabled="1" apc.stat = "1" apc.max_file_size = "1M" apc.localcache = "1" apc.localcache.size = "128" apc.shm_segments = "1" apc.ttl = "3600" apc.user_ttl = "7200" apc.gc_ttl = "3600" apc.cache_by_default = "1" apc.filters = "" apc.write_lock = "1" apc.num_files_hint= "512" apc.user_entries_hint="4096" apc.shm_size = "128M" apc.mmap_file_mask=/tmp/apc.XXXXXX apc.include_once_override = "0" apc.file_update_protection="2" apc.canonicalize = "1" apc.report_autofilter="0" apc.stat_ctime="0" 的好措施:

{{1}}

如果有人需要任何其他配置文件或部分配置文件,我会留意这个帖子,请告诉我。

0 个答案:

没有答案