Three Lightweight webserver--lighttpd,thttpd,shttpd Introduction

Source: Internet
Author: User
Tags benchmark md5 cpu usage

Most of the domestic Web server is not IIS is Apache, and on the market share, I think Apache is a big winner, at least half of the Occupy.

But in addition to Iis/apache, we have a lot of options, for high-load/large concurrent sites, high-performance, lightweight Web server is a good medicine. The recent load on the server was too high for the machine to run out of swap, and later it turned out that Apache had consumed almost all of its resources, when the Apache process was 9XX.

Then, replacing Apache with a lightweight Web server has entered the timeline. Here's an introduction to these optional objects:

lighttpd | thttpd | Shttpd

lighttpd

Official homepage: www.lighttpd.net

LIGHTTPD is a German-led open source software whose fundamental purpose is to provide a secure, fast, compatible, and flexible Web server environment dedicated to high-performance websites. It has very low memory overhead, low CPU usage, good performance, and rich module features.

LIGHTTPD is one of the best in many opensource lightweight Web servers. Support FastCGI, CGI, Auth, export compression (output compress), url rewriting, alias and other important functions, and Apache is popular, very much because of the rich features, in the lighttpd a lot of features have been implemented accordingly, This is important for Apache users, because migrating to LIGHTTPD has to face these problems.

In Google search, Simplified Chinese introduction lighttpd's article almost no, most of them are Taiwanese compatriots Big5 content. So in the next time, want to write a good introduction lighttpd, as well as simple benchmark article.

Practical lighttpd indeed very good, the above mentioned Apache overload problem, with the lighttpd on the complete solution. The main problem with Apache is intensive concurrency, constant fork () and switching, and a high (relative to lighttpd) memory footprint, which dries up the system's resources. The LIGHTTPD uses the multiplex technology, the code is optimized, the volume is very small, the resource occupies very low, and the reaction speed is quite fast.

Using Apache's rewrite technology, the heavy cgi/fastcgi task is handed over to LIGHTTPD to make the best use of both, and now the load on that server has dropped by an order of magnitude, and the reaction speed has increased by one or even 2 orders of magnitude.

thttpd

Official website: http://www.acme.com/software/thttpd/

THTTPD is a very small lightweight web server, it is very simple, just provide http/1.1 and simple CGI support, on its official website has a comparison with other Web server (such as Apache, Zeus, etc.) of the contrast chart +benchmark, You can refer to the reference. In addition, the THTTPD is similar to lighttpd, and instead of using fork () to derive subprocess processing for concurrent requests, it is implemented using multiplexing (multiplex) technology. So the performance is very good.

THTTPD supports a variety of platforms such as FreeBSD, SunOS, Solaris, BSD, Linux, OSF, etc. For small Web servers, the speed seems to be synonymous with the benchmark provided by the official station, it can be said that: thttpd at least as fast as the mainstream Web server, under high load faster, because its resource consumption is small.

THTTPD also has a more compelling feature: URL-based file traffic throttling, which is very convenient for download traffic control. Like Apache, you have to use plug-ins to achieve less efficiency than thttpd.

shttpd

Official website: http://sourceforge.net/projects/shttpd/

The

Shttpd is another lightweight Web server that has richer features than THTTPD, supports CGI, SSL, cookies, MD5 authentication, and embeds (embedded) into existing software. The most interesting is that the configuration file is not required. Because SHTTPD can embed other software, it can be very easy to develop the embedded system Web server, the official website says SHTTPD if using UCLIBC/DIELIBC (a simplified subset of LIBC) the overhead will be very very low. Here's what it does:

stand-alone server, or embeddable into existing C + + program
GET, POST, PUT, DELETE methods
CGI
SSL
Digest (MD5) Authorization
Multiple (and user defineable) index files
Directory listing
Standard Logging
Cookies
inetd mode
user-defineable MIME types
No configuration files
No external dependencies

Because shttpd can easily be embedded in other programs, SHTTPD is the ideal prototype for Web server development, and developers can develop their own webserver based on SHTTPD.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.