From owner-freebsd-questions Sun Feb 17 14:47:30 2002 Delivered-To: freebsd-questions@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id BB99A37B417; Sun, 17 Feb 2002 14:47:24 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 971B0AE608; Sun, 17 Feb 2002 14:47:24 -0800 (PST) Date: Sun, 17 Feb 2002 14:47:24 -0800 From: Alfred Perlstein To: Terry Lambert Cc: Miguel Mendez , hiten@uk.FreeBSD.org, hackers@FreeBSD.org, freebsd-questions@FreeBSD.org Subject: Re: in-kernel HTTP Server for FreeBSD? Message-ID: <20020217224724.GL12136@elvis.mu.org> References: <20020217143343.41758.qmail@web21104.mail.yahoo.com> <20020217173609.A25030@energyhq.homeip.net> <3C703154.91ED7FB4@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C703154.91ED7FB4@mindspring.com> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Terry Lambert [020217 14:41] wrote: > Miguel Mendez wrote: > > As others have pointed out, it may have big hacker value, but no one > > would use it for anything serious. AFAIK there's no such thing for > > FreeBSD, but one thing I remember, is that once the Linux kernel incorporated > > the zero copy netowrking code, userland HTTP servicing like Tux saw it's > > performance increase on par with khttpd, so it seems that's not worth to > > run a http server in kernel space. > > First, livelock means that top end load on a khttpd will be > higher than top end load on a user http, where there is so > much interrupt traffic that the user space never gets to run. > > Actually, Alfred claims to be the first person to pre-load > porn into the FreeBSD kernel, and his approach seriously > predates the khttpd work. 8-). Yes, preloading pron into the kernel does make it serve quite a bit faster. :) I basically made an API that allowed one to load and unload "objects" from the kernel then use a sendfile(2) like syscall to send them. I was servicing 5000 connections a second for 1x1 gifs or several thousand per second (saturating 100mbit) for larger images. I also used kqueue. The real problem is that most of the generic web servers available (as well as most commercial ones) just suck for handling IO and events. A well thought out design can give you quite a perf boost without needing to stick the _entire_ thing into the kernel. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message