<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[张宴的博客]]></title> 
<link>http://zyan.cc/index.php</link> 
<description><![CDATA[Web系统架构与底层研发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[张宴的博客]]></copyright>
<item>
<link>http://zyan.cc/post/375/</link>
<title><![CDATA[Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[Web服务器]]></category>
<pubDate>Tue, 28 Oct 2008 08:55:12 +0000</pubDate> 
<guid>http://zyan.cc/post/375/</guid> 
<description>
<![CDATA[ 
	　　[文章作者：张宴 本文版本：v1.0 最后修改：2008.10.28 转载请注明原文链接：<a href="http://blog.zyan.cc/post/375/" target="_blank">http://blog.zyan.cc/post/375/</a>]<br/><br/>　　VPS（全称Virtual Private Server）是利用最新虚拟化技术在一台物理服务器上创建多个相互隔离的虚拟私有主机。它们以最大化的效率共享硬件、软件许可证以及管理资源。对其用户和应用程序来讲，每一个VPS平台的运行和管理都与一台独立主机完全相同，因为每一个VPS均可独立进行重启并拥有自己的root访问权限、用户、IP地址、内存、过程、文件、应用程序、系统函数库以及配置文件。<br/><br/>　　VPS服务器最重要的指标就是内存大小，多个VPS服务器可以共享一颗CPU，但不能共享同一块内存。内存越大，价格越贵。<br/><br/>　　下面，以我的博客所在的VPS为例，介绍在<span style="color: #FF0000;">128M内存</span>下对 Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 的优化。<br/><br/>　　至于 Nginx + PHP + MySQL 的安装配置，可参见：《<a href="post/366.htm" target="_blank">Nginx 0.7.x + PHP 5.2.6（FastCGI）搭建胜过Apache十倍的Web服务器（第4版）</a> 》<br/><br/><hr/><br/>　　<strong>优化后的效果：</strong><br/><br/>　　提供HTTP服务的1个Nginx进程占用11M物理内存，5个php-cgi进程每个占用8M左右物理内存，1个MySQL服务器占用7M物理内存，加上两个占用内存不大的Nginx和php-cgi父进程，Nginx + PHP + MySQL 系列总共只占用47.7%的物理内存，即62M物理内存（128M * 47.7% ≈ 62M）。<br/><br/>　　<a href="http://zyan.cc/attachment/200810/vps_top.gif" target="_blank"><img src="http://zyan.cc/attachment/200810/vps_top.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>　　另外，VPS服务器系统自身和其它程序也会使用一些内存，但128M内存的VPS已经够用。总体而言，经过优化后，128M内存的VPS跑 Nginx + PHP + MySQL 效果不错。当然，如果有Money购买更大内存的VPS，就更好了。<br/><br/><hr/><br/>　　<strong>优化项如下：</strong><br/><br/>............<br/><br/>Tags - <a href="http://zyan.cc/tags/linux/" rel="tag">linux</a> , <a href="http://zyan.cc/tags/php/" rel="tag">php</a> , <a href="http://zyan.cc/tags/mysql/" rel="tag">mysql</a> , <a href="http://zyan.cc/tags/nginx/" rel="tag">nginx</a> , <a href="http://zyan.cc/tags/vps/" rel="tag">vps</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1806</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>无名 &lt;wt4679758@126.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 28 Oct 2008 09:31:32 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1806</guid> 
<description>
<![CDATA[ 
	我想知道优化前的内存站用情况！！？？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1807</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>zeagles &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 28 Oct 2008 10:29:31 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1807</guid> 
<description>
<![CDATA[ 
	研究研究~~
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1810</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>爱月 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 28 Oct 2008 23:58:50 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1810</guid> 
<description>
<![CDATA[ 
	哇～更新的真快～昨天刚做完服务器配置～今天刚好有优化设置～太棒了～<br/>不过我在unixSNS的Nginx组群里提的问题木有人回答哦。。。张大大拜托看下回答下，谢谢啦～
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1811</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>jcold &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 29 Oct 2008 00:32:37 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1811</guid> 
<description>
<![CDATA[ 
	可不可以问下，你的VPS在哪个地方买的？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1815</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>呵呵 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 29 Oct 2008 05:31:27 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1815</guid> 
<description>
<![CDATA[ 
	 &nbsp;好使
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1816</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>sszxgwh &lt;g.w.h@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 29 Oct 2008 07:54:14 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1816</guid> 
<description>
<![CDATA[ 
	老大动作真快<br/>参考学习学习
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1823</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>iakuf &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 29 Oct 2008 16:07:37 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1823</guid> 
<description>
<![CDATA[ 
	什么地方的空间啊，我也想买一个介绍一下
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1827</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>jason &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 30 Oct 2008 02:11:50 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1827</guid> 
<description>
<![CDATA[ 
	好奇128M可以应负的访问量
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1830</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>KENN &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 30 Oct 2008 10:45:38 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1830</guid> 
<description>
<![CDATA[ 
	首先感谢APMServ5.2.6开发者张宴,这个软件真的很不多,特别适合我们新手,呵呵!谢谢了!<br/><br/>我有些问题需要请教,希望张宴能抽空回答一下,万分感谢!<br/><br/>我的是一台家用电脑装APMServ5.2.6的,操作系统是XP,在测试过程中,发现配置以下问题:<br/><br/>worker_processes 1;#一台独立的服务器,进程数最好设置是多少?<br/><br/>error_log &nbsp;/APMServ5.2.6/APMServ5.2.6/nginx/logs/error.log &nbsp;crit;<br/><br/>pid &nbsp; &nbsp; &nbsp; &nbsp;/APMServ5.2.6/APMServ5.2.6/nginx/logs/nginx.pid;<br/><br/>events &#123;<br/> &nbsp; &nbsp;worker_connections &nbsp;64;#并发数只有64会不会太少呢,我尝试修改大于64,发现行不通,请问是什么问题,怎样才能修改加大呢.<br/>&#125;<br/><br/>如何增加在 Nginx 下虚拟主机呢.<br/>还有如何限制每个IP并发数呢?
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1834</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>xi2008wang &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 30 Oct 2008 16:54:07 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1834</guid> 
<description>
<![CDATA[ 
	@KENN<br/><br/>1.进程数看CPU与内存, 一般两核2个, 4核4个<br/>2.events事件处理方法默认是select最大支持64, 使用epoll可以支持更大的连接数<br/>3.增加虚拟主机，只要复制一段server， 再修改一下就可以了<br/>4.单IP并发数， 使用 limit_conn httplimit指令
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1837</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>LEO &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 31 Oct 2008 04:03:13 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1837</guid> 
<description>
<![CDATA[ 
	张大师厉害啊，折腾vps啦<br/><br/>谢谢分享，很有参考价值
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1853</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>kenn &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 31 Oct 2008 15:06:50 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1853</guid> 
<description>
<![CDATA[ 
	感谢xi2008wang的热心回答
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1856</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>温泉の泡泡 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 31 Oct 2008 18:48:46 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1856</guid> 
<description>
<![CDATA[ 
	我测试去看看，谢谢张宴的文章
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1859</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>aixin &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sat, 01 Nov 2008 05:21:36 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1859</guid> 
<description>
<![CDATA[ 
	128可以承受的并发是多少！
]]>
</description>
</item><item>
<link>http://zyan.cc/post/375/#blogcomment1900</link>
<title><![CDATA[[评论] Nginx 0.7.x + PHP 5.2.6（FastCGI）+ MySQL 5.1 在128M小内存VPS服务器上的配置优化[原创]]]></title> 
<author>digitalpmp &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 04 Nov 2008 04:34:20 +0000</pubDate> 
<guid>http://zyan.cc/post/375/#blogcomment1900</guid> 
<description>
<![CDATA[ 
	[root@server source]# swapon /var/swapfile <br/>swapon: /var/swapfile: Operation not permitted<br/><br/>为什么我创建不了 swap?
]]>
</description>
</item>
</channel>
</rss>