Re: Strange problem while epoll handling after fork&exec
- From: Elanoir <Taehwan.Weon@xxxxxxxxx>
- Date: Tue, 30 Dec 2008 00:40:42 -0800 (PST)
On Dec 28, 7:23 pm, David Schwartz <dav...@xxxxxxxxxxxxx> wrote:
Hi, Thanks for your reply.
On Dec 27, 1:03 am, Elanoir <Taehwan.W...@xxxxxxxxx> wrote:I think so, but almost same model seems to be used in apache.
For faster processing massive TCP connection requests, I am using
epoll.
Okay, so you are dealing with a high rate of connection establishment.
For serialized call to accept from multiple processes, I am using file
lock similar to apache's one.
But you are serializing 'accept', which slows things down.
For faster access, if one process has the right(exactly lock) to
accept,
it can accept up to 10 pending connection requests at one time.
Can you explain you architecture more clearly? Is there only oneYes, you are right. I am made one listening port shared by more than
listening socket that is shared by multiple processes? Do you ever
have any preference on which process accepts connections?
two
processes. There is no preference on which process accept connections.
Only one of the processes can accept the incoming connections if it is
idle.
You don't want more than one process calling 'epoll' on the sameIf accept-and-handover is possible in linux, it would be the best
listening socket because you will get a thundering herb. But
serializing 'accept' is not the solution, since it's not 'accept'
that's the problem but discovery on the listening socket.
If you only have one listening socket, I would recommend only having
one process that accepts connections on it. This process can hand off
connections to other processes as desired, based on load or whatever.
DS
solution to me.
Could you please let me get any hint of that?
In my implementation,
I have one 'master' process.
when it started up, it makes a socket bound to a service port,
and forks several processes which come to listen the bound socket.
In this processing flow, is it possible to do 'accept-and-handover' an
accepted socket to
child processes after forked?
If you let me know any hint, I would be really really appreciated.
Thanks in advance.
THW
.
- Follow-Ups:
- Re: Strange problem while epoll handling after fork&exec
- From: David Schwartz
- Re: Strange problem while epoll handling after fork&exec
- References:
- Strange problem while epoll handling after fork&exec
- From: Elanoir
- Re: Strange problem while epoll handling after fork&exec
- From: David Schwartz
- Strange problem while epoll handling after fork&exec
- Prev by Date: Re: Strange problem while epoll handling after fork&exec
- Next by Date: Re: Strange problem while epoll handling after fork&exec
- Previous by thread: Re: Strange problem while epoll handling after fork&exec
- Next by thread: Re: Strange problem while epoll handling after fork&exec
- Index(es):
Relevant Pages
|