<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>深度VPS &#187; Cache</title>
	<atom:link href="http://www.deepvps.com/tag/cache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>lighttpd配置gzip和cache</title>
		<link>http://www.deepvps.com/config-lighttpd-with-gzip-and-cache.html</link>
		<comments>http://www.deepvps.com/config-lighttpd-with-gzip-and-cache.html#comments</comments>
		<pubDate>Sat, 01 May 2010 16:04:34 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[服务器环境搭建]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=415</guid>
		<description><![CDATA[配置gzip主要是使用compress模块

1. 激活compress模块，将lightppd.conf文件的mod_compress的注释去掉
2. 配置压缩文件存放目录compress.cache-dir，注意运行lighttpd的用户需要有这个目录的读写权限，压缩文件的类型compress.filetype
3. 将动态生成的php也gzip，修改php.ini，加上zlib.output_compression = On和zlib.output_handler = On
4. 重启lighttpd

配置cache主要是使用expire模块

1. 激活expire模块，将lightppd.conf文件的mod_expire的注释去掉
2. 配置需要设置过期时间的host
3. 重启lighttpd

最后配置如下：

$HTTP[&#34;host&#34;] =~ &#34;blog.xiaocaihua.com$&#34; {
&#160;
#其他配置...
compress.cache-dir  =  &#34;/home/flymouse/lighttpd/compress/&#34;
compress.filetype  =  (&#34;text/plain&#34;, &#34;text/html&#34;, &#34;application/x-javascript&#34;, &#34;text/css&#34;, &#34;application/javascript&#34;, &#34;text/javascript&#34;)
$HTTP[&#34;url&#34;] =~ &#34;(.png&#124;.css&#124;.js&#124;.jpg&#124;.gif)$&#34; {
expire.url = ( &#34;&#34; =&#38;gt; &#34;access 2 months&#34; ) # 配置静态文件缓存2个月
}
}

最后的Response header应该如下图，有Content-Encoding和Expires，max-age头。

                 http响应的头信息 
参考

1. mod_compress 文档
2. mod_expire 文档

转自 ：小菜花
]]></description>
			<content:encoded><![CDATA[<p>配置gzip主要是使用compress模块</p>
<ol>
<li>1. 激活compress模块，将lightppd.conf文件的mod_compress的注释去掉</li>
<li>2. 配置压缩文件存放目录compress.cache-dir，注意运行lighttpd的用户需要有这个目录的读写权限，压缩文件的类型compress.filetype</li>
<li>3. 将动态生成的php也gzip，修改php.ini，加上zlib.output_compression = On和zlib.output_handler = On</li>
<li>4. 重启lighttpd<span id="more-415"></span></li>
</ol>
<p>配置cache主要是使用expire模块</p>
<ol>
<li>1. 激活expire模块，将lightppd.conf文件的mod_expire的注释去掉</li>
<li>2. 配置需要设置过期时间的host</li>
<li>3. 重启lighttpd</li>
</ol>
<p>最后配置如下：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">$HTTP[&quot;host&quot;] =~ &quot;blog.xiaocaihua.com$&quot; {
&nbsp;
#其他配置...
compress.cache-dir  =  &quot;/home/flymouse/lighttpd/compress/&quot;
compress.filetype  =  (&quot;text/plain&quot;, &quot;text/html&quot;, &quot;application/x-javascript&quot;, &quot;text/css&quot;, &quot;application/javascript&quot;, &quot;text/javascript&quot;)
$HTTP[&quot;url&quot;] =~ &quot;(.png|.css|.js|.jpg|.gif)$&quot; {
expire.url = ( &quot;&quot; =&amp;gt; &quot;access 2 months&quot; ) # 配置静态文件缓存2个月
}
}</pre></div></div>

<p>最后的Response header应该如下图，有Content-Encoding和Expires，max-age头。</p>
<p><a href="http://www.deepvps.com/wp-content/uploads/auto_save_image/2010/05/161017Gzm.png"><img title="http响应的头信息" src="http://www.deepvps.com/wp-content/uploads/auto_save_image/2010/05/161017Gzm.png" alt="http response header info" width="298" height="191" /></a></p>
<p>                 http响应的头信息 </p>
<p>参考</p>
<ol>
<li>1. <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress" target="_blank">mod_compress 文档</a></li>
<li>2. <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModExpire" target="_blank">mod_expire 文档</a></li>
</ol>
<p>转自 ：<a href="http://blog.xiaocaihua.com/archives/2010/01/config-lighttpd-with-gzip-and-cache.html" target="_blank">小菜花</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/config-lighttpd-with-gzip-and-cache.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>三款免费的PHP加速器：APC、eAccelerator、XCache比较</title>
		<link>http://www.deepvps.com/apc-eaccelerator-xcache.html</link>
		<comments>http://www.deepvps.com/apc-eaccelerator-xcache.html#comments</comments>
		<pubDate>Mon, 15 Mar 2010 01:07:55 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS优化]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[eAccelerator]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[XCache]]></category>
		<category><![CDATA[加速器]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=232</guid>
		<description><![CDATA[一、PHP加速器介绍
        PHP加速器是一个为了提高PHP执行效率，从而缓存起PHP的操作码，这样PHP后面执行就不用解析转换了，可以直接调用PHP操作码，这样速度上就提高了不少。
        Apache中使用mod_php的请求、响应执行流程：
1、Apache接收请求。
2、Apache传递请求给mod_php。
3、mod_php定位磁盘文件，并加载到内存中。
4、mod_php编译源代码成为opcode树。
5、mod_php执行opcode树。

       PHP加速器相应的就是第四步，它的目的就是防止PHP每次请求都重复编译PHP代码，因为在高访问量的网站上，大量的编译往往没有执行速度快呢？所以这里面有个瓶颈就是PHP的重复编译既影响了速度又加载了服务器负载，为了解决此问题，PHP加速器就这样诞生了。
二、PHP加速器安装与配置
        1、安装配置APC
             APC全称是Alternative PHP Cache,官方翻译叫”可选PHP缓存”,它是PHP PECL中的一个扩展，好像是facebook在使用它，下面开始安装（ubuntu环境）：       

$wget http://pecl.php.net/get/APC-3.0.19.tgz 
$tar xvzf APC-3.0.19.tgz 
$cd APC-3.0.19/APC-3.0.19 
$/usr/local/php/bin/phpize 
$./configure –enable-apc –enable-apc-mmap –with-php-config=/usr/local/php/bin/php-config 
$make 
$sudo make install 

      下面我们再配置APC,因为我的PECL扩展路径改变了，所以我得移动下编译好的文件：

$sudo mv /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/apc.so /usr/local/php/lib/php/extensions/PECL 

      然后我们再编辑php.ini文件进行配置，请把下面的代码加入到php.ini中即可：

extension_dir = &#8221;/usr/local/php/lib/php/extensions/PECL&#8221; 
extension = apc.so 
; APC 
apc.enabled = 1 
apc.shm_segments = 1 
apc.shm_size = 64 
apc.optimization = 1 
apc.num_files_hint = 0 
apc.ttl = 0 
apc.gc_ttl = 3600 
apc.cache_by_default = on 

     这样重启apache就会在phpinfo()信息中显示。
       2、安装配置eAccelerator
          eAccelerator的前身其实是truck-mmcache，因为开发truk-mmcache的人被Zend给招安了，所以开发eAccelerator的人继承了truk-mmcache的一些特性，设计出eAccelerator加速器。安装如下：

$wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.tar.bz2 
$tar -jxf eaccelerator-0.9.5.tar.bz2 
$cd eaccelerator-0.9.5 
$/usr/local/php/bin/phpize 
$./configure –enable-eaccelerator=shared –with-php-config=/usr/local/php/bin/php-config 
$make 
$sudo make install 
$sudo mv /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so /usr/local/php/lib/php/extensions/PECL

        将下面代码加入php.ini文件中

extension = eaccelerator.so 
; eAccelerator 
eaccelerator.shm_size = &#8221;16&#8243; 
eaccelerator.cache_dir = &#8221;/tmp/eaccelerator&#8221; 
eaccelerator.enable = &#8221;1&#8243; 
eaccelerator.optimizer = &#8221;1&#8243; 
eaccelerator.check_mtime = &#8221;1&#8243; 
eaccelerator.debug = &#8221;0&#8243; 
eaccelerator.filter = &#8221;" 
eaccelerator.shm_max = &#8221;0&#8243; 
eaccelerator.shm_ttl = &#8221;0&#8243; 
eaccelerator.prune_period = &#8221;0&#8243; 
eaccelerator.shm_only = &#8221;0&#8243; 
eaccelerator.compress = &#8221;1&#8243; 
eaccelerator.compress_level = &#8221;9&#8243; 

       创建缓存目录,重启apache

$sudo mkdir /tmp/eaccelerator 
$sudo chmod 777 /tmp/eaccelerator 
$sudo /usr/local/apache/apachectl restart

      在phpinfo()检查是否安装成功. 
    3、安装配置XCache
      XCache作为国人自己开发的东西，做小菜鸟的我也感到骄傲，而且XCache无论在速度还是性能上都做的不错。下面就赶紧让我们品尝它吧！

$wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz 
$tar xvzf xcache-1.2.2.tar.gz 
$cd xcache-1.2.2 
$/usr/local/php/bin/phpize 
$./configure –enable-xcache –enable-xcache-coverager –with-php-config=/usr/local/php/php-config 
$make 
$sudo make install 
$sudo mv /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/xcache.so /usr/local/php/lib/php/extensions/PECL

     在php.ini添加配置信息：

extension = xcache.so 
; xcache 
xcache.admin.user = &#8221;admin&#8221; 
xcache.admin.pass = &#8221;(执行) echo ’(你的密码)’&#124;md5sum(得出的密文)&#8221; 
; 
xcache.size = 24M 
xcache.shm_scheme = &#8221;mmap&#8221; 
xcache.count = 2 
xcache.slots = 8k 
xcache.ttl = 0 
xcache.gc_interval = 0 
 
xcache.var_size = 8M 
xcache.var_count = 1 
xcache.var_slots = 8k 
xcache.var_ttl = 0 
xcache.var_maxttl = 0 
xcache.var_gc_interval = 300 
xcache.test = Off 
xcache.readonly_protection = On 
xcache.mmap_path = &#8221;/tmp/xcache&#8221; 
xcache.coredump_directory = &#8221;" 
xcache.cacher = On 
xcache.stat = On 
xcache.optimizer = Off 
; 
xcache.coverager = On 
xcache.coveragedump_directory = &#8221;" 

    创建缓存目录，重启apache

$sudo mkdir /tmp/xcache 
$sudo chmod 777 /tmp/xcache 
$sudo /usr/local/apache/bin/apachectl restart 

    去查看phpinfo()信息吧！
三、PHP加速器测试
    1、测试环境
        硬件:   AMD Athlon 64 X2 Dual Core Processor 4400+ @ 2.2GHz  CPU,  2GB 内存. 160GB SATA 硬盘
        软件:   Linux Ubuntu server Gutsy 7.10, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>一、PHP加速器介绍</strong></p>
<p>        PHP加速器是一个为了提高PHP执行效率，从而缓存起PHP的操作码，这样PHP后面执行就不用解析转换了，可以直接调用PHP操作码，这样速度上就提高了不少。</p>
<p>        Apache中使用mod_php的请求、响应执行流程：</p>
<p>1、Apache接收请求。<br />
2、Apache传递请求给mod_php。<br />
3、mod_php定位磁盘文件，并加载到内存中。<br />
4、mod_php编译源代码成为opcode树。<br />
5、mod_php执行opcode树。</p>
<p><span id="more-232"></span></p>
<p>       PHP加速器相应的就是第四步，它的目的就是防止PHP每次请求都重复编译PHP代码，因为在高访问量的网站上，大量的编译往往没有执行速度快呢？所以这里面有个瓶颈就是PHP的重复编译既影响了速度又加载了服务器负载，为了解决此问题，PHP加速器就这样诞生了。</p>
<p><strong>二、PHP加速器安装与配置</strong></p>
<p>        <strong>1、安装配置APC</strong></p>
<p>             APC全称是Alternative PHP Cache,官方翻译叫”可选PHP缓存”,它是PHP PECL中的一个扩展，好像是facebook在使用它，下面开始安装（ubuntu环境）：       </p>
<div id="code">
<li>$wget http://pecl.php.net/get/APC-3.0.19.tgz </li>
<li>$tar xvzf APC-3.0.19.tgz </li>
<li>$cd APC-3.0.19/APC-3.0.19 </li>
<li>$/usr/local/php/bin/phpize </li>
<li>$./configure –enable-apc –enable-apc-mmap –with-php-config=/usr/local/php/bin/php-config </li>
<li>$make </li>
<li>$sudo make install </li>
</div>
<p>      下面我们再配置APC,因为我的PECL扩展路径改变了，所以我得移动下编译好的文件：</p>
<div id="code">
<li>$sudo mv /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/apc.so /usr/local/php/lib/php/extensions/PECL </li>
</div>
<p>      然后我们再编辑php.ini文件进行配置，请把下面的代码加入到php.ini中即可：</p>
<div id="code">
<li>extension_dir = &#8221;/usr/local/php/lib/php/extensions/PECL&#8221; </li>
<li>extension = apc.so </li>
<li>; APC </li>
<li>apc.enabled = 1 </li>
<li>apc.shm_segments = 1 </li>
<li>apc.shm_size = 64 </li>
<li>apc.optimization = 1 </li>
<li>apc.num_files_hint = 0 </li>
<li>apc.ttl = 0 </li>
<li>apc.gc_ttl = 3600 </li>
<li>apc.cache_by_default = on </li>
</div>
<p>     这样重启apache就会在phpinfo()信息中显示。</p>
<p><strong>       2、安装配置eAccelerator</strong></p>
<p>          eAccelerator的前身其实是truck-mmcache，因为开发truk-mmcache的人被Zend给招安了，所以开发eAccelerator的人继承了truk-mmcache的一些特性，设计出eAccelerator加速器。安装如下：</p>
<div id="code">
<li>$wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.tar.bz2 </li>
<li>$tar -jxf eaccelerator-0.9.5.tar.bz2 </li>
<li>$cd eaccelerator-0.9.5 </li>
<li>$/usr/local/php/bin/phpize </li>
<li>$./configure –enable-eaccelerator=shared –with-php-config=/usr/local/php/bin/php-config </li>
<li>$make </li>
<li>$sudo make install </li>
<li>$sudo mv /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so /usr/local/php/lib/php/extensions/PECL</li>
</div>
<p>        将下面代码加入php.ini文件中</p>
<div id="code">
<li>extension = eaccelerator.so </li>
<li>; eAccelerator </li>
<li>eaccelerator.shm_size = &#8221;16&#8243; </li>
<li>eaccelerator.cache_dir = &#8221;/tmp/eaccelerator&#8221; </li>
<li>eaccelerator.enable = &#8221;1&#8243; </li>
<li>eaccelerator.optimizer = &#8221;1&#8243; </li>
<li>eaccelerator.check_mtime = &#8221;1&#8243; </li>
<li>eaccelerator.debug = &#8221;0&#8243; </li>
<li>eaccelerator.filter = &#8221;" </li>
<li>eaccelerator.shm_max = &#8221;0&#8243; </li>
<li>eaccelerator.shm_ttl = &#8221;0&#8243; </li>
<li>eaccelerator.prune_period = &#8221;0&#8243; </li>
<li>eaccelerator.shm_only = &#8221;0&#8243; </li>
<li>eaccelerator.compress = &#8221;1&#8243; </li>
<li>eaccelerator.compress_level = &#8221;9&#8243; </li>
</div>
<p>       创建缓存目录,重启apache</p>
<div id="code">
<li>$sudo mkdir /tmp/eaccelerator </li>
<li>$sudo chmod 777 /tmp/eaccelerator </li>
<li>$sudo /usr/local/apache/apachectl restart</li>
</div>
<p>      在phpinfo()检查是否安装成功.<strong> </strong></p>
<p><strong>    3、安装配置XCache</strong></p>
<p>      XCache作为国人自己开发的东西，做小菜鸟的我也感到骄傲，而且XCache无论在速度还是性能上都做的不错。下面就赶紧让我们品尝它吧！</p>
<div id="code">
<li>$wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz </li>
<li>$tar xvzf xcache-1.2.2.tar.gz </li>
<li>$cd xcache-1.2.2 </li>
<li>$/usr/local/php/bin/phpize </li>
<li>$./configure –enable-xcache –enable-xcache-coverager –with-php-config=/usr/local/php/php-config </li>
<li>$make </li>
<li>$sudo make install </li>
<li>$sudo mv /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/xcache.so /usr/local/php/lib/php/extensions/PECL</li>
</div>
<p>     在php.ini添加配置信息：</p>
<div id="code">
<li>extension = xcache.so </li>
<li>; xcache </li>
<li>xcache.admin.user = &#8221;admin&#8221; </li>
<li>xcache.admin.pass = &#8221;(执行) echo ’(你的密码)’|md5sum(得出的密文)&#8221; </li>
<li>; </li>
<li>xcache.size = 24M </li>
<li>xcache.shm_scheme = &#8221;mmap&#8221; </li>
<li>xcache.count = 2 </li>
<li>xcache.slots = 8k </li>
<li>xcache.ttl = 0 </li>
<li>xcache.gc_interval = 0 </li>
<li> </li>
<li>xcache.var_size = 8M </li>
<li>xcache.var_count = 1 </li>
<li>xcache.var_slots = 8k </li>
<li>xcache.var_ttl = 0 </li>
<li>xcache.var_maxttl = 0 </li>
<li>xcache.var_gc_interval = 300 </li>
<li>xcache.test = Off </li>
<li>xcache.readonly_protection = On </li>
<li>xcache.mmap_path = &#8221;/tmp/xcache&#8221; </li>
<li>xcache.coredump_directory = &#8221;" </li>
<li>xcache.cacher = On </li>
<li>xcache.stat = On </li>
<li>xcache.optimizer = Off </li>
<li>; </li>
<li>xcache.coverager = On </li>
<li>xcache.coveragedump_directory = &#8221;" </li>
</div>
<p>    创建缓存目录，重启apache</p>
<div id="code">
<li>$sudo mkdir /tmp/xcache </li>
<li>$sudo chmod 777 /tmp/xcache </li>
<li>$sudo /usr/local/apache/bin/apachectl restart </li>
</div>
<p>    去查看phpinfo()信息吧！</p>
<p><strong>三、PHP加速器测试</strong></p>
<p><strong>    1、测试环境</strong></p>
<p>        <strong>硬件</strong>:   AMD Athlon 64 X2 Dual Core Processor 4400+ @ 2.2GHz  CPU,  2GB 内存. 160GB SATA 硬盘</p>
<p>        <strong>软件</strong>:   Linux Ubuntu server Gutsy 7.10, Apache 2.2.4, MySQL 5.0.45 和 PHP 5.2.3</p>
<p>        <strong>测试指令</strong>:  ab -c5 -n3000 http://example.com/      (我们使用的是Apache Benchmark (ab) 工具，并发连接为5，3000次请求)</p>
<p>    <strong>2、测试结果</strong></p>
<p>       <strong>无任何加速器</strong>:</p>
<div id="code">
<li>Document Path:          / </li>
<li>Document Length:        21757 bytes </li>
<li>Concurrency Level:      5 </li>
<li>Time taken for tests:   288.255212 seconds </li>
<li>Complete requests:      3000 </li>
<li>Failed requests:        0 </li>
<li>Write errors:           0 </li>
<li>Total transferred:      66777000 bytes </li>
<li>HTML transferred:       65271000 bytes </li>
<li>Requests per second:    10.41 [#/sec] (mean) </li>
<li>Time per request:       480.425 [ms] (mean) </li>
<li>Time per request:       96.085 [ms] (mean, across all concurrent requests) </li>
<li>Transfer rate:          226.23 [Kbytes/sec] received </li>
<li>Connection Times (ms) </li>
<li>min  mean[+/-sd] median   max </li>
<li>Connect:        0    0   0.5      0      19 </li>
<li>Processing:   181  479 186.0    444    1822 </li>
<li>Waiting:      166  461 184.7    427    1708 </li>
<li>Total:        181  479 186.0    444    1822 </li>
<li>Percentage of the requests served within a certain time (ms) </li>
<li>50%    444 </li>
<li>66%    525 </li>
<li>75%    577 </li>
<li>80%    619 </li>
<li>90%    732 </li>
<li>95%    819 </li>
<li>98%    946 </li>
<li>99%   1012 </li>
<li>100%   1822 (longest request)  </li>
</div>
<p>     <strong>APC加速器</strong>:   </p>
<div id="code">
<li>Document Path:          / </li>
<li>Document Length:        21757 bytes </li>
<li>Concurrency Level:      5 </li>
<li>Time taken for tests:   98.530068 seconds </li>
<li>Complete requests:      3000 </li>
<li>Failed requests:        0 </li>
<li>Write errors:           0 </li>
<li>Total transferred:      66777000 bytes </li>
<li>HTML transferred:       65271000 bytes </li>
<li>Requests per second:    30.45 [#/sec] (mean) </li>
<li>Time per request:       164.217 [ms] (mean) </li>
<li>Time per request:       32.843 [ms] (mean, across all concurrent requests) </li>
<li>Transfer rate:          661.84 [Kbytes/sec] received </li>
<li>Connection Times (ms) </li>
<li>min  mean[+/-sd] median   max </li>
<li>Connect:        0    0   0.0      0       2 </li>
<li>Processing:    58  163  71.2    155    2452 </li>
<li>Waiting:       53  158  69.6    150    2329 </li>
<li>Total:         58  163  71.2    155    2452 </li>
<li>Percentage of the requests served within a certain time (ms) </li>
<li>50%    155 </li>
<li>66%    178 </li>
<li>75%    193 </li>
<li>80%    204 </li>
<li>90%    235 </li>
<li>95%    258 </li>
<li>98%    285 </li>
<li>99%    302 </li>
<li>100%   2452 (longest request)  </li>
</div>
<p>     <strong> eAccelerator加速器</strong>:</p>
<div id="code">
<li>Document Path:          / </li>
<li>Document Length:        21757 bytes </li>
<li>Concurrency Level:      5 </li>
<li>Time taken for tests:   95.983986 seconds </li>
<li>Complete requests:      3000 </li>
<li>Failed requests:        0 </li>
<li>Write errors:           0 </li>
<li>Total transferred:      66777000 bytes </li>
<li>HTML transferred:       65271000 bytes </li>
<li>Requests per second:    31.26 [#/sec] (mean) </li>
<li>Time per request:       159.973 [ms] (mean) </li>
<li>Time per request:       31.995 [ms] (mean, across all concurrent requests) </li>
<li>Transfer rate:          679.39 [Kbytes/sec] received </li>
<li>Connection Times (ms) </li>
<li>min  mean[+/-sd] median   max </li>
<li>Connect:        0    0   0.1      0       3 </li>
<li>Processing:    57  159  91.3    148    3830 </li>
<li>Waiting:       50  152  89.8    142    3704 </li>
<li>Total:         57  159  91.3    148    3830 </li>
<li>Percentage of the requests served within a certain time (ms) </li>
<li>50%    148 </li>
<li>66%    174 </li>
<li>75%    193 </li>
<li>80%    205 </li>
<li>90%    239 </li>
<li>95%    263 </li>
<li>98%    289 </li>
<li>99%    309 </li>
<li>100%   3830 (longest request) </li>
</div>
<p>       <strong>XCache加速器</strong>:</p>
<div id="code">
<li>Document Path:          / </li>
<li>Document Length:        21757 bytes </li>
<li>Concurrency Level:      5 </li>
<li>Time taken for tests:   99.76300 seconds </li>
<li>Complete requests:      3000 </li>
<li>Failed requests:        0 </li>
<li>Write errors:           0 </li>
<li>Total transferred:      66777000 bytes </li>
<li>HTML transferred:       65271000 bytes </li>
<li>Requests per second:    30.28 [#/sec] (mean) </li>
<li>Time per request:       165.127 [ms] (mean) </li>
<li>Time per request:       33.025 [ms] (mean, across all concurrent requests) </li>
<li>Transfer rate:          658.19 [Kbytes/sec] received </li>
<li>Connection Times (ms) </li>
<li>min  mean[+/-sd] median   max </li>
<li>Connect:        0    0   0.0      0       2 </li>
<li>Processing:    59  164  83.4    155    3367 </li>
<li>Waiting:       52  156  66.4    148    1802 </li>
<li>Total:         59  164  83.4    155    3367 </li>
<li>Percentage of the requests served within a certain time (ms) </li>
<li>50%    155 </li>
<li>66%    178 </li>
<li>75%    196 </li>
<li>80%    206 </li>
<li>90%    237 </li>
<li>95%    263 </li>
<li>98%    287 </li>
<li>99%    305 </li>
<li>100%   3367 (longest request)  </li>
</div>
<p><strong>    3、结果摘要</strong></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td> </td>
<td>请求时间(秒)</td>
<td>单次请求时间(毫秒)</td>
<td>最大内存占用(MB)</td>
<td>最小内存占用(MB)</td>
</tr>
<tr>
<td>None</td>
<td>10.41</td>
<td>96.08</td>
<td>24</td>
<td>24</td>
</tr>
<tr>
<td>APC</td>
<td>30.45</td>
<td>32.84</td>
<td>21</td>
<td>21</td>
</tr>
<tr>
<td>eAccelerator</td>
<td>31.26</td>
<td>31.99</td>
<td>23</td>
<td>18</td>
</tr>
<tr>
<td>XCache</td>
<td>30.28</td>
<td>33.02</td>
<td>29</td>
<td>19</td>
</tr>
</tbody>
</table>
<p><strong>四、PHP加速器比较结果总结</strong></p>
<p>     1、通过测试得出eAccelerator在请求时间和内存占用综合方面是最好的。</p>
<p>     2、通过测试得出使用加速器比无加速器在请求时间快了3倍左右。</p>
<p>     3、通过各个官方观察，XCache是更新最快的，这也说明最有发展的。</p>
<p>        以上是总结结果，你也许会问我到底用那个加速器好呢？我只能告诉你，首先，用一定比不用好，其次每个加速器还有一些可以调优的参数，所以要根据你的系统环境而定，然后，我个人觉得你可以详细研究下eAccelerator和XCache，这两款潜力还是很大的，最后我从比较专业的测试网站搞了一张结果图：</p>
<p>       <img src="http://www.deepvps.com/wp-content/uploads/auto_save_image/2010/03/011237dmd.jpg" alt="" width="642" height="541" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/apc-eaccelerator-xcache.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
