Lighttpd
lighttpdベンチマーク
2008年12月11日
lighttpdをapache(prefork)と比較してみた。
グラフが長いほど高速。
単純なHTMLファイルの読み込みだと、apacheに比べて約3倍高速。
PHPの実行は約1.1倍apacheの方が早い。
lighttpd+PHPが遅い理由は、fastCGIを経由するからかなぁ
fastCGI用のPHPインストール
2008年12月11日
lighttpdでPHPを利用するためにはfastCGI APIを使ってlighttpdから呼ばれる。
それに対応したPHPのバイナリを作る。
apxs対応のモジュールの作成とは同時にできない。
% wget http://jp2.php.net/get/php-5.2.8.tar.gz/from/this/mirror % tar zxf php-5.2.8.tar.gz % cd php-5.2.8 % ./configure --enable-fastcgi --enable-force-cgi-redirect --enable-discard-path --enable-mbstring --enable-soap --enable-zend-multibyte --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-curl --with-curlwrappers --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-mcrypt --with-bz2 --enable-zip --with-mysqli % make # sudo cp sapi/cgi/php-cgi /usr/local/bin/php-cgi
lighttpd.confにPHPの設定が書いてあるから、コメントアウトを外す。
以下に該当部分を記載する。
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php-cgi"
)
)
)
Lighttpd installation
2008年12月11日
Lighttpdのベンチマークするためにソースコードからインストール。
$ wget http://www.lighttpd.net/download/lighttpd-1.4.20.tar.gz $ tar zxf lighttpd-1.4.20.tar.gz $ cd lighttpd-1.4.20 $ ./configure --prefix=/usr/local/lighttpd $ make # make install # cp doc/rc.lighttpd /etc/init.d/lighttpd # chkconfig --add lighttpd # mkdir /usr/local/lighttpd/etc/ # cp doc/lighttpd.conf /usr/local/lighttpd/etc

最近のコメント