Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1261699
  • 博文数量: 315
  • 博客积分: 10397
  • 博客等级: 上将
  • 技术积分: 3731
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 21:21
文章分类

全部博文(315)

文章存档

2015年(10)

2014年(3)

2013年(2)

2012年(8)

2011年(8)

2010年(29)

2009年(59)

2008年(77)

2007年(119)

分类: LINUX

2007-12-12 13:35:06

转自:

在maillist中看到Rasmus的一段对于 APC模块的发言。作为APC的作者,他的见解应该是很有参考价值的。

APC will probably be 20-30% faster, but if you are writing to it frequently it can cause problems. The APC cache is best for things that change very rarely. And by very rarely I mean days, not hours or minutes.

Because of the way APC does an anonymous file-backed mmap where I unlink the file at startup to get process-death protection, it isn’t easy to get at the cache from a separate standalone command line script. That can be solved by mmap’ing slightly differently, but in the default config your approach won’t work.

-Rasmus

就是说APC不适合用于频繁写的场合,你最好只用它来保存那种几天都不会更改的内容。否则出了莫名其妙的问题就不好怎么解释了。

在以前的应用中,我确实有将apc用在频繁写的场合,偶尔会出现内存耗尽,进而引起所有http请求卡死,形式一发不可收拾整个服务器当掉。所以现在我仅仅用apc来缓存opcode的php代码,不在程序中显式的调用它,算是相安无事。

APC是什么

Alternative PHP Cache (APC)是一种对PHP有效的开放源高速缓冲储存器工具,它能够缓存opcode的php中间码。

阅读(713) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~