Linuxsky
中国青基会
您当前的所在的位置是:主页>自由文档>网络服务> 文章页面

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

去论坛讨论 来源:CU首发 作者:wigeboy 发布时间:2007-04-25
 在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

共4页: 上一页 1 [2] [3] [4] 下一页

免费注册 | 网站地图 | RSS订阅 | 友情链接 | 论坛交流 | 用户搏客 | 返回顶端

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

本站原创作品除特别声明外皆以创作共用协议发布