# apachectl graceful restart issues



## csross (Sep 2, 2004)

I put up a new apache server:

Server version: Apache/2.2.4 (Unix) - Solaris 10 - Sparc
FILE /usr/local/apache2/bin/httpd
/usr/local/apache2/bin/httpd: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped

When I do a apachectl graceful restart, 

- the number of processes increases equal the number of Min spare. 
- the server status screen shows all G (gracefully finishing) for the old and new processes (not idle processes)
- the # requests currently being processed never changes 

These are the settings for both servers. 
----------------------
StartServers 20
MinSpareServers 40
MaxSpareServers 75
ServerLimit 500
MaxClients 500


I am using these same settings on a live server running 2.2.3 - Solaris 8, and although it has started 52 processes, the status screen does not display G for each processes. 
4 requests currently being processed, 49 idle workers 
---------------------------

Any ideas how to stop the runaway spawning and not displaying G on the status screen?

Thanks


----------



## csross (Sep 2, 2004)

I was doing some research and found this. Mod_perl is called with a Load_Module statement in my httpd.conf am not sure how this affects things. Ths is a brand new install of Apache 2.2.4 with mod_perl 2. I'm not even running any scripts now, just running apachectl graceful and then looking at the status screen (where I see lots of G's for the each existing and new process it starts). I don't even have any users on yet.

http://modperlbook.org/html/ch22_04.html

This is from that code article:
If after doing a graceful restart (e.g, by sending kill -USR1) you see via mod_status or Apache::VMonitor that a process is stuck in state G (Gracefully finishing), it means that the process is hanging in perl_destruct( ) while trying to clean up. If you don't need the cleanup, see the previous section on how to disable it.

This is the section before

If you are certain that your code does not contain any END blocks or DESTROY methods to be run during child server shutdown, you can avoid the delays by setting the PERL_DESTRUCT_LEVEL environment variable to -1. Be careful, however; even if your code doesn't include any END blocks or DESTROY methods, any modules you use( ) might.


----------



## csross (Sep 2, 2004)

I recompiled another version of apache that is working on a different server and I didn't have the problem with graceful restarts UNTIL I uncommented the line for ssl (I have openssl 0.9e). When I included the ssl.conf, the graceful restarts wouldn't end for the previous processes and it spawns new ones (which I believe it is supposed to) The parent process ID for the new and the old are the same. I even brought in the ssl.conf from that server and the problem remains. 

Any ideas?

7824 in state: G , 7825 in state: G , 7826 in state: G 
7827 in state: G , 7828 in state: G , 7838 in state: _ 
7839 in state: _ , 7840 in state: _ , 7841 in state: W 
7842 in state: _ , 7843 in state: _ ,


----------



## csross (Sep 2, 2004)

Further testing reveals that if I repeatedly do "apachectl -k restart" I can get one or more log entries, and one of the previous processes specified by the G, has cleared. How can I get them to end automatically instead of doing another restart?

Also, as I specified, this only happens when the ssl.conf is Included.

[Wed May 23 14:18:16 2007] [error] (70007)The timeout specified has expired: apr_pollset_poll: (listen)
[Wed May 23 14:18:16 2007] [notice] Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7d configured -- resuming normal operations


----------

