I was bored a few nights ago, and pissed of with how slow (relativly) apache is, especially when using it in a mass-hosting enviroment.
So, I knocked up ZHpD, it's not much, but it works (sort of), and it's feckin' fast :-)
Server Software: Zhpd/0.1
Server Hostname: 10.255.2.8
Server Port: 8080
Document Path: /index.html
Document Length: 611 bytes
Concurrency Level: 100
Time taken for tests: 0.465 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Non-2xx responses: 1000
Total transferred: 680009 bytes
HTML transferred: 611000 bytes
Requests per second: 2150.54 [#/sec] (mean)
Time per request: 46.50 [ms] (mean)
Time per request: 0.47 [ms] (mean, across all concurrent requests)
Transfer rate: 1462.38 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 6
Processing: 1 2 13.6 1 218
Waiting: 0 2 13.6 1 218
Total: 1 2 13.8 1 223
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 2
80% 2
90% 2
95% 3
98% 7
99% 9
100% 223 (last request)
Now, thats over 100mb network, yeah... it is Zhpd running with 4 processes, each with 4 threads. You can configur eas you see fit for your hardware, etc.
It's not even got a config file, it's all done in defines.h, maybe one day i'll add it, who knows.
It's taken a fair bit of code (all the HTTP_* status code defines, some URI/advanced pointer/string manipulation) from apache, as i don't see the point in re-inventing the wheel. The idea of this was to make a very, very small, light, damn fast webserver - and thats what i did.
It uses libavl for a fair bit of stuff, and it also uses pthreads, sooooo, it will only compile on linux, and it also takes advantage of some libc extensions, so don't expect it to compile on any other system. Like I said before, the reason of writting this was for something I need, a small, fast, efficent webserver for use in mass-hosting - seeing as I only use linux with libc6 (ok, and some BSD and solaris, but hey...), thats what i wrote it for ;) maybe if it actually becomes usefull, i'll give it the normal package job using autoconf, and sort it so it's portable :p
It's not really HTTP compliant yet, but it will work withh all browsers, plain HTML, that is. Ohh, didn't i tell you? It only serves up HTML ;) And it leaks memory in a few places, so don't go using it for anythign except playing!
I'm working on it occasionally when i bored and feel like doing some C coding, so it may even improve and become funkier.
Right now i'm just proud it serves up HTML :p
The license: GPL.