APC文件缓存不工作,但用户缓存是罚款 [英] APC File Cache not working but user cache is fine

查看:275
本文介绍了APC文件缓存不工作,但用户缓存是罚款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

摘要:我已经安装了PHP作为Apache模块(5.3.8),并通过PECL安装APC。用户缓存工作正常,但文件缓存不工作(我有apc.cache_by_default为1,这不是问题)

Summary: I have PHP(5.3.8) installed as an Apache Module, and installed APC via PECL. The User cache is working fine but the File Cache is not working ( I do have apc.cache_by_default set to 1 so that's not the issue)

说明:
我刚刚得到一个VPS(带的cPanel / WHM)来测试什么斩获我可以在我的应用程序获取使用APC文件缓存和用户高速缓存。

Detail: I have just got a VPS (with cPanel/WHM) to test what gains i could get in my application with using apc file cache AND user cache.

所以我就编译为DSO(Apache模块)。在PHP 5.3

So I got the PHP 5.3 compiled in as a DSO (apache module).

然后通过SSH通过PECL安装APC。 (首先,我有南国模块安装尝试,它也有同样的问题,所以我通过ssh尝试了)

Then installed APC via PECL through SSH. (First I tried with WHM Module installer, it also had the same problem, so I tried it via ssh)

一切似乎都很好,表现出的phpinfo APC加载并启用。

All seemed fine and phpinfo showed apc loaded and enabled.

然后我apc.php检查。一切似乎确定

Then I checked with apc.php. All seemed OK

但正如我开始测试我的PHP应用程序中,APC的统计信息文件高速缓存信息的状态:

But as I started testing my php application, the stats in apc for File Cache Information state:

Cached Files    0 ( 0.0 Bytes)  
Hits    1  
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  

这意味着任何PHP文件都被缓存,即使我已通过了10 PHP文件有多个,包括浏览。所以,一定有一些缓存文件。

Which meant no PHP files were being cached, even though I had browsed through over 10 PHP files having multiple includes. So there must have been some Cached Files.

但用户高速缓存功能正常。

But the user cache is functioning fine.

User Cache Information  
Cached Variables    0 ( 0.0 Bytes)  
Hits    1000  
Misses  1000  
Request Rate (hits, misses) 0.84 cache requests/second  
Hit Rate    0.42 cache requests/second  
Miss Rate   0.42 cache requests/second   
Insert Rate 0.84 cache requests/second  
Cache full count    0

以上用户高速缓存的输出是它试图检索和存储1000个条目,并给我的倍APC缓存测试脚本。一个简单的排序基准的。

The above user cache output is from an APC caching test script which tries to retrieve and store 1000 entries and gives me the times. A sort of simple benchmark.

谁能帮我在这里。结果
尽管apc.cache_by_default = 1时,PHP文件被缓存。

Can anyone help me here.
Even though apc.cache_by_default = 1, no php files are being cached.

这是我的APC的配置

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   
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   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    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

还有大多数PHP文件正在20KB,因此apc.max_file_size = 1M是不是原因。

Also most php files are under 20KB, thus, apc.max_file_size = 1M is not the cause.

我试过,没有运气下面的东西。

I've tried following things with no luck.


  1. 使用apc_compile_file迫使一些文件到运code高速缓存,没有运气。

  2. 重新安装APC与调试启用,​​但没有说明会在error_log

  3. 设置mmap_file_mask到/ dev /零/tmp/apc.xxxxxx,我还设置/ tmp目录的权限为777无济于事

  4. 设置apc.enable_cli = 1,并从CLI
  5. 运行脚本
  6. 设置apc.max_file_size = 5M(以防万一)

  7. 切换PHP处理从DSO到的FastCGI在WHM(然后切换回DSO,因为它并没有解决这个问题)

  8. 甚至试图重新启动容器

任何线索的人。

注意:我已经贴在serverfault.com这个问题,但并没有获得太多的意见或答案,所以我在这里发帖(如计算器似乎更加积极,我也只拿到了1一个月来测试我的VPS,看看它是否是在共享的任何使用)

Note: I had posted the question on serverfault.com but did not get much views or an answer so I'm posting here (as stackoverflow seems to be more active and I have only got 1 month to test my VPS and see if it is of any use over shared)

推荐答案

看来问题是与SourceGuardian。结果
文件缓存正在从php.ini中注释掉延长=ixed.5.3.lin后正常工作。

It seems the problem was with SourceGuardian.
File caching is now working fine after commenting out extension="ixed.5.3.lin" from php.ini.

这是由支持我的托管服务提供商发现了,于是竖起大拇指这样的大力支持。我也不会发现这个问题了好几天。

It was found out by the Support at my hosting provider, so a thumbs up to such great support. I wouldn't have found the issue for days.

思想应该张贴以防别人绊了答案了这个问题。

Thought should post the answer in case someone else stumbles over this problem.

这篇关于APC文件缓存不工作,但用户缓存是罚款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆