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  [EMAIL PROTECTED]  http://www.acme.com/jef/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to