eAccelerator 并不总能提高性能?

发布于 2024-07-29 05:17:28 字数 1552 浏览 4 评论 0原文

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

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

发布评论

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

评论(1

拍不死你 2024-08-05 05:17:28

我从未使用过 eAccelerator,但我总是使用 APC :

我注意到的一些事情(我不太了解 eAccelerator,但我猜想这些想法是一样的)

  • 第一次访问不会更快:它必须将 PHP 编译成操作码,并将其存储在内存中; 只有下一次访问会更快(无需重新编译)
  • 激活 APC,我发现 CPU 负载下降可达 50% (即激活前使用了服务器 CPU 的 80%) APC;激活 APC 时 CPU 使用率在 40% 到 50% 之间)
  • 如果配置不当,不会有真正的性能损失,但情况也不是很好。
    • 例如,如果没有为 APC 提供足够的 RAM,并且 RAM 已满,则 APC 必须从缓存中删除一些条目才能存储新条目; 最后,它将花费相当多的时间来缓存内容,在缓存新内容之后取消缓存它们,并且对于每个页面请求。 所以,不好。
    • 另一个例子是“apc.stat”配置条目(也许 eAccelerator 有类似的东西):如果它设置为 1,对于每个访问的文件,APC 将在磁盘上检查它是否已被修改(与版本相比)在缓存中。 如果设置为 0,APC 将始终使用缓存中的版本,而不检查磁盘上的版本(这意味着您必须刷新缓存才能考虑对文件的修改); 将此选项设置为 0 可能意味着 CPU 负载下降 5% 到 10%

如果您使用的是 Windows,情况可能不会像您希望的那么好; 不确定它是否会降低性能,但是 Windows 上的 Apache+PHP 通常比 Linux 上的 Apache+PHP 慢(有一次,我设置了一个运行 LAP 堆栈的虚拟机;它的响应速度与在 Windows 上运行 WAP 一样快)实体机^^)

现在,有几个问题:

  • 您使用的是哪个版本的 Apache/PHP?
    • 也许是“太新”的版本?
  • 看来eAccelerator已经有一段时间没有新版本了; 最后版本是 2008 年 5 月; 上一篇是 2007 年 9 月的,

您是否尝试过 APC,显然在这方面已经完成了更多的工作?

你会得到什么样的结果?

最后,如需了解更多信息,您能否向我们提供有关您的环境和配置的更多信息? 关于您运行的基准测试类型的一些详细信息?

谢谢:-)

I have never used eAccelerator, but I always work with APC :

A few things I've noted (I don't really know about eAccelerator, but I guess the ideas are the same) :

  • First access will not be faster : it has to compile PHP into opcode, and store it in memory ; only next access will be faster (it will not have to re-compile)
  • Activating APC, I've seen a CPU-load drop that can go up to 50% (ie, 80% of the server's CPU used before activating APC ; between 40% and 50% of CPU used with APC activated)
  • If not well configured, there was no real loss of performance, but things where not great either.
    • For instance, if not enough RAM is given to APC, and it is full, APC will have to remove some entries from the cache to be able to store new ones ; in the end, it'll spend quite some time to cache things, to un-cache them just after to cache new ones, and this, for each page-request. So, not good.
    • Another example is the "apc.stat" config entry (maybe there's something like this for eAccelerator) : if it's set to 1, for each accessed file, APC will check on disk if it has been modified, compared to the version in cache. If set to 0, APC will always use the version in cache, without checking the version on disk (it means you'll have to flush the cache to have a modification on a file be taken into account) ; setting this option to 0 can mean a drop of between 5 and 10 % of CPU load

If you are using Windows, things might not be as bright as you'd hope ; not sure if it could decrease performance, but Apache+PHP on windows is generally slower than Apache+PHP on linux (Once, I set up a virtual machine running a LAP stack ; it was responding as fast as running WAP on the physical machine ^^ )

Now, a couple of questions :

  • Which versions of Apache / PHP are you using ?
    • Maybe a "too recent" version ?
  • It seems there has been no new version of eAccelerator for quite some time, now ; last version is from May 2008 ; the previous one was from september 2007

Have you tried with APC, on which there is apparently more work done ?

What kind of result would you get with that one ?

Finally, for more informations, could you give us more informations about your environment and configuration ? And some details on the kind of benchmark you ran ?

Thanks :-)

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