C-Web-Development: Part Two In one of my last
postings I wrote
about my C Web
Development System
Project. Here is an
update. Autor/Author: Dipl.-Inform. (FH) Steffen Wendzel (Date/Datum: 080330-12:31, Hits: 1067)
If you don't know about the project, you can read my old posting about it. The project currently contains about 2.800 lines of code (LOC) what includes everything: the webserver (cchttpd), a test C Module and the C web development API. I think the first beta version will contain about 5.000 LOC what is still VERY tiny. And yes, it is entirely written in C. I also think about a C++ API for this system but the implementation of a C++ API will be one of the future tasks.
I spent the last week with performance tunings of the webserver software I currently work on (cchttpd). The problem was that (after a first performance tuning (TCPs Nagle algorithm used, sendfile() used and the like) cchttpd 0.1.1 only served about 23.000-29.000 requests in 10 seconds on my notebook while apache 2.2 served 34.000-39.100 requests within 10 seconds (with default config on ubuntu 7.10). lighttpd even served amazing 75.000-76.000 requests within the same time.
After I made an additional performance tuning cchttpd 0.1.2 always served about 28.100 requests within 10 seconds what is better than 23.000-29.1000 I think since it was a stable value of 28.1xx. But this was not enough because apache is still much faster.
But yesterday I made a great improvement by implementing pre-threading and getting rid of a not really needed counter+mutex stuff. cchttpd 0.2.0 can now serve between 51.000 and 55.500 requests within 10 seconds.
Next step is to tune apache and lighttpd config to see what they can really do on with a very good config and improving cchttpd performance again and again. My target is to make cchttpd faster than lighttpd (at least on Linux 2.6). But I think it is still a long way to finish this task.
cchttpd also still misses LOTS of HTTP/1.1 features which will reduce its performance a little bit again. But it is also still far away from a beta version and I plan to invest lots of time to implement HTTP/1.1 features and increase performance very well again.
Here is my docs/performance.txt file:
swendzel@koschka:~/projekte/xyriahttpd$ more docs/performance.txt
Running ./http_load -parallel 100 -seconds 10 urls
Where 'urls' contains only the URL http://127.0.0.1:/index.html
Test-System (running client+server on localhost): 1400 MHz Celeron M,
256 MB RAM, Ubuntu 7.10 (Fujitsu-Siemens Amilo Pro V2030 Notebook)
Server Responses within this 10 seconds
------ --------------------------------
cchttpd/0.1.1 ................. 23.000-29.000 (a.k.a. the "java" version)
cchttpd/0.1.2 ................. 28.000 (a.k.a. "improved java")
cchttpd/0.2.0 ................. 51.000-55.500
Apache 2.2.4/Ubuntu ........... 35.000-39.100
lighttpd/1.4.18 ............... 75.000-76.000
____________
|