Re: Virtual Hosts & FCGI paths, was Re: [VOTE] release httpd mod_fcgid-2.3.1?

2009-09-21 Thread Rainer Jung
On 21.09.2009 13:41, Jeff Trawick wrote:
> On Mon, Sep 21, 2009 at 4:01 AM, Rainer Jung  > wrote:
> 
> On 21.09.2009 09:11, Paul Querna wrote:
> > While, this is obviously a terrible thing for a general purpose
> > module, I would like to propose that we add a 'FCGIIgnoreVirtualHost'
> > configuration option, which would set the vhost field to a constant
> > value, so FCGI processes would be shared between virtual hosts.
> 
> +1, I assume you meant this directive to be used per virtual host, not
> as a global setting?
> 
> Or maybe even a 'FCGIGroup xyz' that lets you choose the string used
> instead of the virtual host name (if set). So you can combine according
> to your needs? On the positive side that would be more flexible, on the
> negative side you would always need to add an argument to the directive
> (or find a better directive name, that makes it more obvious, that with
> a missing argument it defines a default group).
> 
> 
> I like this in general.  Having to supply an argument doesn't sound
> negative to me.
> 
> It is probably inevitable, but the term "Group" here is potentially
> confused with the existing term "Class" (as used in
> DefaultMinClassProcessCount and DefaultMaxClassProcessCount).

I noticed an enty in our Chnagelog for mod_fcgid that actually dates
back to August 2007 (r753578):

1. Patch from Gabriel Barazer, gabriel at oxeva.fr

When setting multiple virtual hosts with the same SuexecUserGroup user
and group, the process manager use the same process pool for both
virtual hosts. This means if one virtual host has a DefaultInitEnv and
the other has different values set, a fastcgi request from any of these
virtual host can go to the same processes, which is inconsistent (a
request from virtualhost a with DefaultInitEnv VAL "a", can go to a
process spawned with virtualhost b with DefaultInitEnv VAL "b" set)

So this reminds us, that if we want to share processes over the
boundaries of VirtualHosts, we have a problem with all configuration
which afftecs those processes and is possible per vhost.

So in order to make the results predictable we need to look for clear
semantics of such a process sharing. I currently do not have one.

Regards,

Rainer


Re: Virtual Hosts & FCGI paths, was Re: [VOTE] release httpd mod_fcgid-2.3.1?

2009-09-21 Thread Rainer Jung
On 21.09.2009 09:11, Paul Querna wrote:
> (Sidenote: This virtualhost code is *only* present in the unix process
> manager, which means there is a separate bug/issue in the win32
> process manager code)

I compared the two spawn functions and made them more consistent in
r817237 (both now using the server_hostname as virtualhost.

Regards,

Rainer


Re: Virtual Hosts & FCGI paths, was Re: [VOTE] release httpd mod_fcgid-2.3.1?

2009-09-21 Thread Jeff Trawick
On Mon, Sep 21, 2009 at 4:01 AM, Rainer Jung wrote:

> On 21.09.2009 09:11, Paul Querna wrote:
> > While, this is obviously a terrible thing for a general purpose
> > module, I would like to propose that we add a 'FCGIIgnoreVirtualHost'
> > configuration option, which would set the vhost field to a constant
> > value, so FCGI processes would be shared between virtual hosts.
>
> +1, I assume you meant this directive to be used per virtual host, not
> as a global setting?
>
> Or maybe even a 'FCGIGroup xyz' that lets you choose the string used
> instead of the virtual host name (if set). So you can combine according
> to your needs? On the positive side that would be more flexible, on the
> negative side you would always need to add an argument to the directive
> (or find a better directive name, that makes it more obvious, that with
> a missing argument it defines a default group).
>

I like this in general.  Having to supply an argument doesn't sound negative
to me.

It is probably inevitable, but the term "Group" here is potentially confused
with the existing term "Class" (as used in DefaultMinClassProcessCount and
DefaultMaxClassProcessCount).


Re: Virtual Hosts & FCGI paths, was Re: [VOTE] release httpd mod_fcgid-2.3.1?

2009-09-21 Thread Rainer Jung
On 21.09.2009 09:11, Paul Querna wrote:
> While, this is obviously a terrible thing for a general purpose
> module, I would like to propose that we add a 'FCGIIgnoreVirtualHost'
> configuration option, which would set the vhost field to a constant
> value, so FCGI processes would be shared between virtual hosts.

+1, I assume you meant this directive to be used per virtual host, not
as a global setting?

Or maybe even a 'FCGIGroup xyz' that lets you choose the string used
instead of the virtual host name (if set). So you can combine according
to your needs? On the positive side that would be more flexible, on the
negative side you would always need to add an argument to the directive
(or find a better directive name, that makes it more obvious, that with
a missing argument it defines a default group).

Regards,

Rainer


Virtual Hosts & FCGI paths, was Re: [VOTE] release httpd mod_fcgid-2.3.1?

2009-09-21 Thread Paul Querna
Hi,

I spoke a little too soon, there is one problem.

mod_fcgid correctly uses the VirtualHost as one of the unique inputs
for each backend daemon.

(Sidenote: This virtualhost code is *only* present in the unix process
manager, which means there is a separate bug/issue in the win32
process manager code)

And while this is technically correct, it causes a problem for
*.apache.org.  As you know, we have something like 70+ TLPs.  While
they are all running the same FastCGI script, each one of these TLPs
has their own subdomain, and therefore mod_fcgid is treating their
scripts as different process groups.

Since we have so many TLPs (go us!), we were looking at roughly 300
mirror.fcgi processes running on our production web server, while if
we were to 'fake' it under one vhost, I believe it would only be 10.

Index: fcgid_pm_unix.c
===
--- fcgid_pm_unix.c (revision 817154)
+++ fcgid_pm_unix.c (working copy)
@@ -434,7 +434,7 @@
 command->deviceid = deviceid;
 command->inode = inode;
 command->share_grp_id = share_grp_id;
-command->virtualhost = r->server->server_hostname;
+command->virtualhost = "apache.org's setup is awesome";

 /* Update fcgid_command with wrapper info */
 command->wrapperpath[0] = '\0';


While, this is obviously a terrible thing for a general purpose
module, I would like to propose that we add a 'FCGIIgnoreVirtualHost'
configuration option, which would set the vhost field to a constant
value, so FCGI processes would be shared between virtual hosts.

ps, patch is deployed to apache.org right now :)
.
> BTW, we are now running mod_fcgid trunk in production for www.apache.org.
>
> wiki.apache.org (MoinMoin powered) is now running in FastCGI mode, via
> mod_fcgid.
>
> I also hacked up all of the download,cgi/mirror.cgi scripts, so they
> are running via fastcgi too ( ,
> , etc)
>
> eating the dogfood quite well right now... :)
>
> -Paul
>