You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Hajo Locke <ha...@gmx.de> on 2011/04/13 10:00:58 UTC

[users@httpd] reload separate fcgid-application

Hello,

is there a possibility to reload a separate fcgid-application (mod_fcgid) if 
something has changed?
May be the php.ini for my wrapper-script has changed and i want to reload 
this application for vhost without disturbing other apps.
Is this possible? I think a reload of apache stops all fcgid-applications 
and force to restart them, is this notice correct? there are a lot of httpd 
<defunct> in processlist after reloading apache.
iam afraid of killed apps and a cpu-overload if a lot applications start at 
the same time.

Thanks,
Hajo 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] reload separate fcgid-application

Posted by Björn Zettergren <bj...@basefarm.se>.
On 04/19/2011 09:03 AM, Hajo Locke wrote:
>> You could issue a "kill <pid>" of your fcgi-wrapper process that
>> handles your specific vhost

> Do you have often trouble with your users when killing the processes or
> are these killings barely noticeable?

I don't, but i think that is highly dependant on what kind of website 
you're running. Your experience may vary. Good luck!

/Björn

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] reload separate fcgid-application

Posted by Hajo Locke <ha...@gmx.de>.
Hello,

> You could issue a "kill <pid>" of your fcgi-wrapper process that handles 
> your specific vhost (i distinguish mine through the use of different users 
> via suexec, so i can do a "pkill -u <username>"), apache will spawn a new 
> process when it recieves the next request. However, note that this is not 
> graceful, any tasks that the process is up will be stopped.
Seems to me to be more gentle to cpu then reloading all applications.
Do you have often trouble with your users when killing the processes or are 
these killings barely noticeable?

Thanks,
Hajo


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] reload separate fcgid-application

Posted by Björn Zettergren <bj...@basefarm.se>.
On 04/13/2011 10:00 AM, Hajo Locke wrote:
> is there a possibility to reload a separate fcgid-application
> (mod_fcgid) if something has changed?

Hi,

You could issue a "kill <pid>" of your fcgi-wrapper process that handles 
your specific vhost (i distinguish mine through the use of different 
users via suexec, so i can do a "pkill -u <username>"), apache will 
spawn a new process when it recieves the next request. However, note 
that this is not graceful, any tasks that the process is up will be 
stopped.

There might very well be better ways to do this, if anyone has a better 
idea, please let me/us know :-)

/Björn



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] reload separate fcgid-application

Posted by Hajo Locke <ha...@gmx.de>.
> I am not very familiar with mod_fcgid, but hat you want is possible with 
> what I am running:
>
> httpd 2.3.12-dev with mod_proxy_fcgi
> PHP 5.3.7-dev with php-fpm
interesting, but not an option for productive systems.
the killing of user-processes, like suggested by Björn, also isnt a nice 
solution but more practicable.
on well visited servers too much parallel starting php-procesess are able to 
overload whole machine.
i can not find any hints by the developer to avoid cpu-impact after 
reloading apache.
hmm, no official recommend procedure?

Thanks,
Hajo 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] reload separate fcgid-application

Posted by Mark Montague <ma...@catseye.org>.
  On April 13, 2011 4:00 , "Hajo Locke" <ha...@gmx.de>  wrote:
> is there a possibility to reload a separate fcgid-application 
> (mod_fcgid) if something has changed?
> May be the php.ini for my wrapper-script has changed and i want to 
> reload this application for vhost without disturbing other apps.
> Is this possible? I think a reload of apache stops all 
> fcgid-applications and force to restart them, is this notice correct? 
> there are a lot of httpd <defunct> in processlist after reloading apache.
> iam afraid of killed apps and a cpu-overload if a lot applications 
> start at the same time.

I am not very familiar with mod_fcgid, but hat you want is possible with 
what I am running:

httpd 2.3.12-dev with mod_proxy_fcgi
PHP 5.3.7-dev with php-fpm

php-fpm runs as a separate service from Apache HTTP Server; it is 
started by the system init scripts (just as httpd is).  Sending a 
SIGUSR2 to php-fpm will cause it to gracefully reload all workers and 
re-read its configuration file.  While this causes *all* applications 
(pools) to be reloaded gracefully (without end users noticing), it 
should be possible to set up multiple instances of php-fpm, each with 
its own config file, with each instance having one pool with one 
application -- you can then send the SIGUSR2 to only the master process 
of php-fpm that handles the application you want to have reloaded.

While what I describe above is "bleeding edge" -- and so might be a 
longer-term strategy rather than an immediately usable one for most 
people -- httpd 2.3 is in beta and a general (non-beta) release of 2.4 
seems to be not very far away.  Note that php-fpm from PHP 5.3.6 won't 
work out of the box with mod_proxy_fcgi, but a fix for this has already 
been accepted and will be in PHP 5.3.7 when it is released.

--
   Mark Montague
   mark@catseye.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org