February 20, 2006

fnord : 極小但完整的 web server

有些朋友要我推薦給 MIPS 或 ARM7 平台的輕量級 http daemon,過去會想到 lighthttpd,不過現在有新的選擇 [fnord],Debian 也有收錄。官方網頁 [Comparing fnord to other web servers] 做了令人印象深刻的比較,引用如下:
Namestatic binary sizeGETCGIkeep-alivevirtual hostingremarks
fnord13k/18kyesyesyesyesthe reference ;)
ghttpd37kyesGET onlynoyesfound a buffer overflow with the first grep
cherokee14kyesnononoTwo orders of magnitude slower than fnord on my laptop
其功能也令人驚艷:
  • Small! (13k static Linux-x86 binary without CGI, 18k with CGI)
  • Fast! (see this document), uses mmap (and on Linux, sendfile)
  • Scalable! (see this plot from Linux 2.5.50, measured using this Linux 2.4+ specific hack. The fnord plot ends at 8000 connections because I couldn't open more connections before fnord kept timing out the old ones)
  • connection keep-alive
  • el-cheapo virtual domains (similar to thttpd)
  • IPv6 support (through tcpserver)
  • CGI (through pipes, not temp files like Apache)
  • Content-Range (not the full specs, just a-b or a- byte ranges)
  • transparent content negotiation (will serve foo.html.gz if foo.html was asked for and browser indicates it understands deflate, same for foo.png for foo.gif and image/png)
  • Now also with directory index generation (-DDIR_LIST).
fnord 透過 [tcpserver] 啟動,另外,fnord 內部的 [libowfat] 很特別,包裝了一系列字串與 buffer 處理的 routines。
由 jserv 發表於 February 20, 2006 10:42 AM
迴響

您好
小弟對 lightweight web server 很有興趣
因為前一陣子買了一台 Kuro-Box/HG
感覺硬體不是很夠力

以我古早的印象 宣稱是lightweight的有
thttpd, mathopd, boa, monkey httpd, thy...
我目前使用 mathopd + fast-cgi + php4
雖不知道該如何準確測試 但總覺得不夠快
而lighttpd上面的benchmark拿掉了mathopd
所以也不知道該如何選擇
不知道您建議使用哪一個web server?
在系統很陽春的情況下(powerpc266 + 128M RAM)

謝謝

eggice 發表於 February 23, 2006 11:07 AM

To eggice,

你的硬體其實 *太快了*,該考量的反而是 web suite 的組合與適用性的議題,還有,你的 web application 的類型也很重要。因為多數的開發人員勢必先在 Desktop 作先期開發,對 resource 的掌握不甚有概念,這是相當危險的議題,問題並非在 web server 本身。

jserv 發表於 February 23, 2006 01:28 PM

的確, 我是跑lifetype 1.0.3
頗有膛臂擋車的感覺
我會試試其他的blog系統
多謝你 讓我有正確的方向
受教了..

eggice 發表於 February 24, 2006 01:13 PM

fnord對soft link有個奇怪的問題(或者不算是問題…)
只能接受一層,不接受第二層的。
例如:
/webroot/default/index.html -> /home/blc/www/index.html -> /home/www/normal.html
這時只會解到/home/blc/www/index.html,並出現該檔案找不到的訊息…
而且在網址列會出現http://myip/home/blc/www/index.html的位置…

設定上不知道能不能改…

blc 發表於 April 9, 2006 03:31 PM

我錯了…那是chroot的效果…

blc 發表於 April 9, 2006 10:46 PM