Date: Fri, 20 Apr 2001 09:11:32 -0700 From: Jef Poskanzer <jef@acme.com> To: Alfred Perlstein <bright@wintelcom.net> Cc: sthaug@nethelp.no, hackers@FreeBSD.ORG Subject: Re: thttpd hack for sendfile and accept filters. Message-ID: <200104201611.JAA95537@bomb.acme.com> In-Reply-To: Your message of Fri, 20 Apr 2001 05:23:37 PDT.
next in thread | raw e-mail | index | archive | help
The accept-filters change is already on my short list to add. I'll probably use your version. sendfile() probably doesn't make sense in a non-blocking server - wouldn't it block until the entire file is sent? I do plan to use it in my other server mini_httpd. As for making thttpd use multiple processes (each doing non-blocking I/O), yes definitely. I did it in the commercial server I worked on for a while and it was a big win. There are two parts to this: - Collect global state into a single struct and share it among the processes via an anonymous mmap. This would include the throttling table. - A round-robin token-passing scheme to determine which process gets to do the accept(). Turns out it's very bad to just have all the processes do an accept(), since every time there's a new connection *all* the processes wake up. The context switches totally kill performance. But a properly tuned round-robin scheme works great. I'm not sure when I'll add this, but it's definitely in the works. --- Jef Jef Poskanzer jef@acme.com http://www.acme.com/jef/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104201611.JAA95537>