什么是用PHP / Apache的运算code缓存最简单的方法? [英] what is the easiest way for opcode caching with PHP/Apache?

查看:107
本文介绍了什么是用PHP / Apache的运算code缓存最简单的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用性能运算利润code缓存

I was thinking to use opcode caching for performance profit

什么是用PHP / Apache的运算code缓存最简单的方法?
什么是性能改进?

what is the easiest way for opcode caching with PHP/Apache ? and what are the performance improvements ?

我已经读到了XDebug,但如果有更多的选择我想知道?

I have read about xDebug but I was wondering if there are more options ?

推荐答案

我使用 APC扩展既是我的personnal服务器运算code高速缓存,并在服务器上,我们使用的是在工作 - 并且我几乎从来没有碰到任何麻烦与它

I use the APC extension as an opcode cache on both my personnal server, and on the servers we are using at work -- and I've almost never run into any kind of trouble with it.

结果
安装pretty简单:这取决于您的Linux发行版,你可能想使用这样的:


Installation is pretty easy : depending on your Linux distribution, you might want to use something like :

sudo aptitude install php5-apc

但你不一定有最后的稳定版本......我一般都采​​用preFER:

But you'd not necessarily have the last stable version... And I generally prefer using :

sudo pecl install apc

将从PECL获取最新版本并编译它的(注意:您可能需要安装一个叫包的php5-dev的

然后您就必须配置它;看到运行时配置获得可以配置的指令。

You'll then have to configure it ; see Runtime Configuration for the directives you can configure.

结果
性能的提升可以根据您的服务器/应用程序有所不同,但是,这仅提供PHP页面的的服务器上(例如,如果你的数据库是另一台机器上)的,你可能会看到CPU的负荷下降这是非常重要的(我见过的CPU负载从80%到40%-50%的服务器上,一次)


The performance improvements can vary depending on your server/application, but, on a server that only serves PHP pages (i.e. if your DB is on another machine) you might see a drop in CPU load that's quite important (I've seen CPU load go from 80% to 40-50% on a server, once)

结果
Xdebug的是不相关的运算code缓存也不性能:正如其名称所示,这对调试有用


Xdebug is not related to opcode caching nor performance : as its name indicates, it's useful for debugging.

和Xdebug不应安装在生产服务器上:它可以是一个痛苦,当谈到演出 - 我想这是因为它挂钩到PHP,并添加很多东西,如登录调试许多信息有用;这意味着更多的计算做 - 这需要时间和CPU

And Xdebug should not be installed on a production server : it can be a pain, when it comes to performances -- I suppose it's because it "hooks" into PHP and add lots of stuff, like logging many informations useful for debugging ; which means more calculations to do -- which takes time and CPU.

这篇关于什么是用PHP / Apache的运算code缓存最简单的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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