[Info-vax] Apache + mod_php performance

Arne Vajhøj arne at vajhoej.dk
Sun Sep 29 20:02:59 EDT 2024


On 9/29/2024 7:43 PM, Lawrence D'Oliveiro wrote:
> On Sun, 29 Sep 2024 19:16:48 -0400, Arne Vajhøj wrote:
>> On 9/29/2024 6:57 PM, Lawrence D'Oliveiro wrote:
>>> On Sun, 29 Sep 2024 10:46:12 -0400, Arne Vajhøj wrote:
>>>> That is not how Apache prefork MPM works.
>>>
>>> If that’s not how it works, then how can you serve a client from more
>>> than one member of the worker pool?
>>
>> A new request on a new connection goes to another worker. No problem.
> 
> But with keepalive, the request will come in on the existing connection.
> So you have to dedicate a worker process to each connection? That’s
> inefficient.

There is a reason that prefork MPM has been replaced by other
MPM's.

Worker and event MPM on Linux.

WinNT MPM on Windows.

>>>> And I don't understand the "put all the client context into shared
>>>> memory" either. Are you saying that if socket descriptors are put in
>>>> shared memory then any process that map that memory can use those
>>>> sockets????
>>>
>>> No, but the shared-memory context can contain an index into a table of
>>> socket descriptors in private per-process memory. If the process trying
>>> to server a client context does not actually have a socket descriptor
>>> in the slot for that context, it can ask for one.
>>
>> I still can't follow the idea.
>>
>> Client X has a connection to server worker A. That means that A has
>> index 77 in shared memory that points to the socket descriptor for the
>> connection from X.
>>
>> Worker B wants to serve X as well and it get index 77 from shared
>> memory. And then it does what?
> 
> Looks up its entry in its process-private copy of the array that contains
> the socket descriptors, to see if it has its own valid fd for that socket.

Yes. And if it does not then what?

Arne



More information about the Info-vax mailing list