禁用 APC 缓存来缓存文件?

发布于 2024-10-16 14:09:19 字数 196 浏览 2 评论 0原文

我有一个相当大的网站,其中有一个由 phpBB 提供支持的论坛。我启用了 APC,内存为 1Gb。 phpBB 生成大量 php 缓存文件(在我的例子中为 60 000-70 000 个),它们很快填满 APC 内存。我正在考虑通过 apc.filter 选项禁用此类文件的 apc 缓存。在您看来,有道理吗?

I have a quite large website, in which there is a forum powered by phpBB. I have APC enabled with 1Gb of RAM. phpBB generates a lot of php files of cache (60 000-70 000 in my case), and they rapidly fill up APC memory. I was thinking to disable apc caching of such files through the apc.filter option. In your opinion, does it make sense?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

影子的影子 2024-10-23 14:09:19

我已经很长时间没有运行 phpBB 了,所以我的回答是有条件的:

  • 如果这些缓存文件中有实际的 PHP 代码,那么在 APC 中进行缓存是值得的。我可能会更进一步说,它们对于缓存来说非常有价值,因为 phpBB 认为这些文件将被频繁使用,值得缓存。
  • 如果它们包含静态 HTML 或其他非 PHP 内容,请将其过滤掉或说服 phpBB 为它们提供备用扩展名。

您在 APC 中运行数据的速度有多快?如果您以令人难以置信的速度循环遍历缓存未命中,那么您就会遇到问题。如果随着时间的推移,失误次数保持不变且较低,我就不会担心。如果您在 APC 中存储大量用户数据,这可能是减少数据量的一种方法。 apc.php 是获取有关 APC 功能的更多详细信息的好方法,但请记住,这是一个加载成本较高的页面。

(曾在多个每天处理数百万至数千万独立访问者的 PHP 网站工作过)

I haven't run phpBB in a long time, so my answer is conditional:

  • If there's actual PHP code in those cache files, there's worth to be had in caching in APC. I might go a step further and say that they're incredibly valuable to cache, since phpBB feels these files will be used often enough to have been worth caching.
  • If they contain static HTML or other content that's not PHP, filter them out or convince phpBB to give them an alternate extension.

How fast are you running through your data in APC? If you're cycling through cache misses incredibly quickly, you've got a problem. If the number of misses stays constant and low over time I wouldn't worry about it. If you're storing lots of user data in APC that might be a way to shave it down. apc.php is a great way to get more details on what APC is up to, but remember it's an expensive page to load.

(have worked on several PHP sites dealing with millions to tens of millions of unique visitors per day)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文