wiki:Introduction.zh

Version 3 (modified by moo, 7 years ago) (diff)

--

TracNav

XCache 的介绍

(这是 Introduction 页面对应的中文翻译)

XCache 是一个开源的 opcode 缓冲器/优化器, 这意味着他能够提高您服务器上的 PHP 性能. 他通过把编译 PHP 后的数据缓冲到共享内存从而避免重复的编译过程, 能够直接使用缓冲区已编译的代码从而提高速度. 通常能够提高您的页面生成速率 2 到5 倍, 降低服务器负载.

XCache 工程由 mOo 领队, 他也是 Lighttpd 的开发成员之一. Lighttpd 是最快的 Web 服务器应用程序之一, 并且超越 Apache 以及许多其他 Web 服务器. XCache 努力达到类似的效果.

你 (XCache 的作者) 知道 apc, eaccelerator, phpa, truck-mmcache 吗?

我非常了解那些产品.

I noticed phpa (PHP Accelerator) long ago, and looked at truck-mmcache around the time it was still being actively maintained. Sadly phpa's project died and never updated its code to support newly released versions of PHP. So I used truck-mmcache for a period of time, but... it hanged or crashed continously after being under high load. I noticed APC later, but I've been reading both APC/truck-mmcache source for a long time (I couldn't have writen XCache if I hadn't read them), discovering that APC code is simpler and more beautiful than mmcache's. Features are good, but I believe that stability is more important. So I finally turned to run APC online -- simpler often means more stable. mmcache forked eaccelerator later and they setup www.eaccelerator.net, running trac.

但是您为什么又写了个 XCache? 为何不直接参与 ea/apc 的开发?

I DID filing bug report, submiting patches to both http://pecl.php.net/bugs/search.php?cmd=display&package_name[=APC&status=All apc bug report system] and truck-mmcache on sf.net and interactive with communicate with zoeloelip, one of the main developer of eaccelerator. He's the first one read my XCache source, long before XCache is published online. I'm not sure, but i guess the idea he rewrite ea_dasm.c is base on my Disassembler idea in XCache :)

There are many reasons for me to write XCache instead of using APC or EA:

  • Something too big to be made into them (ea/apc).
  • I have many new ideas on opcode cacher, but I just can't break their cacher to prove my ideas.
  • To prove my programming skills? Making project oneself isn't that simple. With only programming skill is far insufficient, you need to become project admin, designing how the project will be, foresee the cost and benefits ... blah blah

To conclude, I've finished writting XCache for quite a long time, before then I had used APC. Although it was quite stable for a php4 with flock() configuration it had become unstable once I upgraded my server to a dual cpu (4 threaded cpu) because it flock()ed badly so XCache was used instead and seems to have solved the problem.

ea/apc is still good opcode cacher, as long as it's maintained actively, and if it's stable for you.

XCache 有什么特殊的?

参见 特色功能?.

另外. 我自己, 开发 XCache 主号集中在研究如何提高稳定性以及代码生成器上.