【发布时间】:2011-12-17 15:15:23
【问题描述】:
我正在使用 APC (3.1.9) 和 Zend Framework,但是,只有一堆文件被缓存(大约 10 / 400)。
你有什么想法吗?我在 debian 安装中使用工厂选项。
编辑:看起来唯一被 opcached 的文件是我用 require ''; 手动调用的文件,但我的自动加载器加载的文件不是。有什么想法吗?
运行时设置
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
apc.gc_ttl 3600
apc.include_once_override 0
apc.lazy_classes 0
apc.lazy_functions 0
apc.max_file_size 1M
apc.mmap_file_mask
apc.num_files_hint 1000
apc.preload_path
apc.report_autofilter 1
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 32M
apc.slam_defense 1
apc.stat 1
apc.stat_ctime 0
apc.ttl 0
apc.use_request_time 1
apc.user_entries_hint 4096
apc.user_ttl 0
apc.write_lock 1
这里是 apc.php 截图
正在被 opcached 的文件
还有我需要文件的 index.php (ZF),并在 Zend_Loader_Autoloader 中注册自动加载器。
【问题讨论】:
-
apc.shm_segments 和 apc.shm_size 的值是多少?什么是“10/400”,你是如何确定这个数字的?
-
嗨,我添加了整个运行时配置,10/400 意味着使用 Zend Framework 和其他库,我在每个请求上加载了大约 400 个文件,但只有 10 个被 opcached。跨度>
-
再次,您是如何确定的,您有 390 次未命中。 :)
-
@Layke,好吧,我知道我已经加载了大约 400 个文件,只有 10 个被 opcached,我在 Apc 提供的 apc.php 脚本中看到它们。