Re: Announce: kHTTPd 0.1.0

Jakub Jelinek (jj@sunsite.ms.mff.cuni.cz)
Tue, 8 Jun 1999 12:57:51 +0200


On Sat, Jun 05, 1999 at 10:12:50PM +0200, Arjan van de Ven wrote:
> Hi,
>
> I have created a kernel-based http-daemon, implemented as a loadable
> module. It started with a discussion on the linux-future list, where two
> groups couldn't agree if kernel-based httpd is a good idea.
>
> I have created such a daemon, so the concept and performance are
> (somewhat) known. Even if the result at the end is that kHTTPd is _not_ a
> good idea (I think it is, though), it can be used for pinpointing
> performance-bottlenecks in the network-code. (kHTTPd can easily saturate a
> 100 Mbit network with a 350 Mhz K6-2 server).

I'd suggest you to check the error handling when some kmalloc/gfp returns
NULL. In some cases kHTTPd will cause memory leaks (e.g. the snippet bellow
looks suspicious to me (if Buffer is NULL but httptime is not, then you'll
leak it)).

Buffer = (char*) get_free_page(GFP_KERNEL);
httptime = kmalloc(sizeof(struct http_time),GFP_KERNEL);

atomic_dec(&InitCount);

if (Buffer == NULL) return 1;
if (httptime == NULL)
{
free_page((unsigned long)Buffer);
return 1;
}

Also, I'd like to suggest if kHTTPd added some way how to explicitely say
which files should be served by kHTTPd and which should be taken care of in
userspace. One way could be if khttpd allowed to specify a permission mask
via /proc or sysctl and if file's permissions & that permission mask would
be non-zero, it would serve it, otherwise it would forward it up. By that
one could e.g. configure the sticky bit of files to trigger this, so if one
has server where some documents need to be handled e.g. according to
requested language or whatever, the admin can exclude them from kHTTPd
processing.

I'm also not sure if limiting extension to 4 characters is a good idea,
because .shtml are common and those definitely should not be served by
kHTTPd, while .html match the same 4 byte extension.

It would be also nice if you could port your daemon to 2.3.x (preferably by
#ifdefing the same sources) and use 2.3.x wake_one semantics.

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.3.4 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/