preforking; sharing a port among workers

26 views
Skip to first unread message

Phoenix Sol

unread,
Apr 8, 2009, 5:49:27 PM4/8/09
to ebbebb
Would it be practical (and straightforward enough) to build a
preforking server on libebb?

I have inquired on the libev list about sharing a listen socket among
processes, but I wanted to try here as well... ;-)

I really like libevent's evhttp_accept_socket(evhttp, fd), which
allows multiple evhttp instances to share a common port. This way, no
explicit delegation of new connections to workers, nor passing of file
descriptors for every connection, is necessary. Easiness.

Is there any means to do this with libebb (or any libev based
server) ?

I don't want to forward or proxy all of my requests! And I want to
reduce copying to a minimum...

This thing looks so flexible, I'm afraid I could strangle myself with
it... It's a good way to go, though ;-)
thanks for sharing code =)

ry

unread,
Apr 8, 2009, 6:37:10 PM4/8/09
to ebbebb
You can fork the server after it begins listening. each worker process
will accept connections independently. I haven't done this yet with
libebb (or libev) but there isn't any particular reason why it
shouldn't work.
Reply all
Reply to author
Forward
0 new messages