LinuxSky:让我们一起学习Linux。

实现lighttpd-1.5+mod_proxy_core+多 Fastcgi backends 解析PHP负载平衡

 在lighttpd.conf 中加入server.network-backend = "linux-aio-sendfile"

标题起的比较诡异,呵呵.这里最主要的想法是多个backends对PHP进行解析,达到负载平衡.

在lighttpd 1.5 已经和之前的版本有了很多新的元素同时也和之前的版本配置上略有不同,下面谈谈我个人的记录笔记.
我们先使用一个新的元素linux-aio-sendfile.和之前有什么不同,我们转一下lighhtpd BLOG上面的数据

大家可以去http://blog.lighttpd.net/articles/2006/11/12/lighty-1-5-0-and-linux-aio查看详细数据.

QUOTE:

Using Async IO allows lighttpd it overlap file-operations. We send a IO-request for the file and get notified when it is ready. Instead of waiting for the file (as in the normal sendfile()) and blocking the server, we can handle other requests instead.
On the other side we give the kernel to reorder the file-requests as it wants to.
Taking this two improments we can increase the throughput by 80%.
On the other side we don’t spend any time in wait in lighty itself. 64 kernel threads are handling the read()-calls for us in the background which increases the idle-time from 12% to 40%, a improvement of 230% .
1.下载编译
lighttpd-1.5

先确保有装 libaio

CODE:
wget http://www.lighttpd.net/download/lighttpd-1.5.0-r1477.tar.gz

tar -zxvf lighttpd-1.5.0-r1477.tar.gz

cd lighttpd-1.5.0

./configure --prefix=/usr/local/lighttpd --with-linux-aio
没有出错的话就

CODE:
make

make install
LightHttpd 会出现在 /usr/local/lighttpd

为lighttpd 建立 用户

CODE:
groupadd lighttpd
useradd -g lighttpd -s /sbin/nologin -d /dev/null lighttpd

mkdir /usr/local/lighttpd/conf
mkdir /usr/local/lighttpd/log

mv ./doc/lighttpd.conf /usr/local/lighttpd/conf/

chown -R lighttpd:lighttpd /usr/local/lighttpd
2.下载编译PHP
使用--enable-fastcgi 来编译 这里不多说了.

记得在php.ini 中把,同时奉上防呆有情提醒,把前面的注释去掉

CODE:
cgi.fix_pathinfo = 0  改为 cgi.fix_pathinfo = 1

标签:lighttpd Fastc
分类: 网络服务 | 发布:wigeboy | 查看: | 发表时间:2007/04/25
分享按钮

相关文章

文章评论

站内资料部分由本人收集整理,所有文章版权均系原作者和出版者所有,如涉版权问题,恳请来信告知!