PHP APC 模块。有什么缺点吗?
我想知道是否有人认为使用 APC 是否有什么缺点?另外,我有兴趣查看下面的这些选项并征求您的意见。
谢谢。
; Enable apc extension module
extension = apc.so
; Options for the apc module
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=256M
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
apc.cache_by_default=1
I wanted to know if anyone thought if there where any disadvantages to using APC? Also, I'd be interested in reviewing these options below and getting your opinion on them.
Thanks.
; Enable apc extension module
extension = apc.so
; Options for the apc module
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=256M
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
apc.cache_by_default=1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上没有,特别是当您与根本不使用任何字节码缓存进行比较时。话虽如此,您可能需要注意以下事项:
APC 是一个附加软件,因此如果 APC 中存在错误,您的网站可能会受到影响。这种情况时有发生,但 APC 是一种广泛使用的软件,因此您遇到尚未发现和修复的错误的可能性非常低,除非对 PHP 进行了一些严重的黑暗魔法。
谨防经常更改的脚本或生成大量可能不会再次使用的文件的应用程序(某些模板系统可能会这样做)。这些会耗尽你的内存并降低缓存效率,使用 apc.filters 忽略此类文件。
Practically none, especially if you're comparing to not using any bytecode cache at all. Having said that, here's something you might need to be aware of:
APC is an additional piece of software, so if there's a bug in APC your site may be affected by it. That happens from time to time, but APC is a widely used software so chances that you'd encounter a bug that wasn't already found and fixed is quite low unless so do some serious dark magic with PHP.
Beware of scripts that change very frequently or of applications that generate large number of files which may not be ever used again (some templating systems might do that). Those would eat up your memory and reduce efficiency of caching, use
apc.filters
to ignore such files.