我启用了APC模块并检查了apc.php实用程序。看起来正常运行时间非常短。我刷新了很多次,我看到最多1分钟。缓存似乎不起作用。我该如何解决这个问题呢?或者您是否建议使用另一种opcache?(我更喜欢APC,因为CakePHP支持它)
我检查并找到了这个question,但在这种情况下使用的是litespeed。我不用litespeed。此question没有可接受的答案。一些类似的question。
我的系统:
PHP 5.4.18
Centos 6.3
APC 3.1.13 PHP服务器API: CGI/FastCGI
服务器: Plesk 11.5
phpinfo是这样的:
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 发布于 2013-09-26 15:29:41
原因是mod_fcgid模块。当您使用fcgid时,它会频繁地产生新的PHP进程。因此,相同的PHP进程不会存在太长时间。它会在一段时间后死亡。
所以缓存是按进程进行的。如果你有5个PHP进程,你就有5个不同的缓存。每个进程都使用自己的缓存。因此,使用modd_fgid + APC或任何其他操作码/操作缓存都不是最佳选择。但它仍然可以帮助提高性能。
https://stackoverflow.com/questions/18540510
复制相似问题