You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stefan Eissing <st...@greenbytes.de> on 2015/06/09 15:37:36 UTC

thread/mpm advice

Hi Knowledgeable List!

someone reported issues with mod_h2 in relation to some mod_proxy/mod_rewrite setup of his. I added several test cases and all seems fine. Then I found out that he is running on a mpm_prefork configuration...

My understanding is that one uses mpm_prefork when threads are to be avoided. This is not what mod_h2 is about and so I consider disabling the module in a prefork configuration. My thinking: if threads are not a problem, why not run worker/event?

Do you have any advice for mod_h2 here? Are there other mpms where the module should disable itself? 

Thanks for the help,

  Stefan

<green/>bytes GmbH
Hafenweg 16, 48155 Münster, Germany
Phone: +49 251 2807760. Amtsgericht Münster: HRB5782




Re: thread/mpm advice

Posted by Stefan Eissing <st...@greenbytes.de>.
Graham and Jim, thanks for the advice.

As to prefork: as long as APR has threads and mutex and all these fine things, I am pretty certain the mod_h2 itself does not have a problem with prefork.

The concern I have is: if people use prefork to have code running which is not thread-safe, that will not make it safe in mod_h2. Or if people use prefork as an indication to avoid mutex and other sync helpers, they will be surprised.

I am just adding a WARNING log on startup (once) that says that mod_h2 in prefork might be a source of unpleasant surprises. But I leave mod_h2 running. 

//Stefan


> Am 09.06.2015 um 17:04 schrieb Graham Leggett <mi...@sharp.fm>:
> 
> On 09 Jun 2015, at 3:37 PM, Stefan Eissing <st...@greenbytes.de> wrote:
> 
>> My understanding is that one uses mpm_prefork when threads are to be avoided. This is not what mod_h2 is about and so I consider disabling the module in a prefork configuration. My thinking: if threads are not a problem, why not run worker/event?
> 
> Getting prefork to work would be a good thing.
> 
> The prefork MPM is the “tank” MPM - regardless of what the client does, regardless of what code is being spawned by httpd, any leak/crash affects that connection only.
> 
> mod_h2 might not be fully featured or fully performant under prefork, but that’s fine in theory.
> 
> Regards,
> Graham
> —
> 

<green/>bytes GmbH
Hafenweg 16, 48155 Münster, Germany
Phone: +49 251 2807760. Amtsgericht Münster: HRB5782




Re: thread/mpm advice

Posted by Graham Leggett <mi...@sharp.fm>.
On 09 Jun 2015, at 3:37 PM, Stefan Eissing <st...@greenbytes.de> wrote:

> My understanding is that one uses mpm_prefork when threads are to be avoided. This is not what mod_h2 is about and so I consider disabling the module in a prefork configuration. My thinking: if threads are not a problem, why not run worker/event?

Getting prefork to work would be a good thing.

The prefork MPM is the “tank” MPM - regardless of what the client does, regardless of what code is being spawned by httpd, any leak/crash affects that connection only.

mod_h2 might not be fully featured or fully performant under prefork, but that’s fine in theory.

Regards,
Graham
—


Re: thread/mpm advice

Posted by Jim Jagielski <ji...@jaguNET.com>.
Prefork is the only (unix) MPM which is non-threaded.

> On Jun 9, 2015, at 9:37 AM, Stefan Eissing <st...@greenbytes.de> wrote:
> 
> Hi Knowledgeable List!
> 
> someone reported issues with mod_h2 in relation to some mod_proxy/mod_rewrite setup of his. I added several test cases and all seems fine. Then I found out that he is running on a mpm_prefork configuration...
> 
> My understanding is that one uses mpm_prefork when threads are to be avoided. This is not what mod_h2 is about and so I consider disabling the module in a prefork configuration. My thinking: if threads are not a problem, why not run worker/event?
> 
> Do you have any advice for mod_h2 here? Are there other mpms where the module should disable itself? 
> 
> Thanks for the help,
> 
>  Stefan
> 
> <green/>bytes GmbH
> Hafenweg 16, 48155 Münster, Germany
> Phone: +49 251 2807760. Amtsgericht Münster: HRB5782
> 
> 
>