Re: httpd.exe -k restart command is closing connections on Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Sorry to no be more precise. I will try to explain my experience with more
details.

My main objective is (on Apache with Windows) to reload the configuration
without interrupting any request still being processed on any TCP
connection.

I believe the command httpd.exe -k restart was designed to do that.

Using Process Explorer I could see how this works. There is a main httpd.exe
process, it is the service process, and there is a child httpd.exe process.
What I could see is that all TCP connections are opened on the main service
process. Now suppose 8 users are downloading a CD ISO at same time, you can
simulate that using the ab.exe application, when you call httpd.exe -k
restart a new child process is created without closing the current one, the
current opened TCP connections on the main process are kept opened too, the
downloding of the CD continue without interreuption. New TCP connections are
open on the main service process but processed by the new chield process. So
the main process will have TCP connections for the old child process and for
the new one. The old child process will be closed when it finish to process
all its requests but it will not receive any new request. It looks like the
configuration are handled by the child processes. The configuration are
loaded when the new chield process starts, the old child process keep using
the old configuration.

What is happening with me is that some times the old child process is closed
with its TCP connections before to finish its requests, but some times not.
Is this a bug?

Using the ab.exe application I'm dowloading a CD ISO with 8 concurrent
connections. Each connection is downloading its own copy of the CD. So in
another console window I call httpd.exe -k restart and sometimes the
downloading is interrupted and sometimes not. When I use 1 or 2 concurrent
connections they are usualy not interrupted.

Daniel


awarnier wrote:
> 
> Hi.
> Referring to your original post, and to the current one below :
> 
> I don't really have the "Apache developer" answer to your questions, but 
> I believe that you should be a little more precise in your descriptions.
> What do you mean (in your first post) by "connections" and (in your last 
> post) by "operations in progress" ?
> 
> I am asking because HTTP is, by design, a connection-less protocol. (Yes 
> I know about KeepAlive, but nevertheless).
> 
> In other words, I would expect Apache, when it restarts (even 
> gracefully), to drop existing TCP sessions (since basically the only 
> ones that would exist would be due to KeepAlive TCP sessions), as long 
> as there is no request still being processed on that connection.
> Apache would need to do that, because any open TCP connection would be 
> held on the server side by a running child (or thread), and to restart 
> that child/thread, that connection would need to be closed.
> 
> But that should not matter.  If a client still has a KeepAlive 
> connection active, but it is not waiting for any response, it will just 
> re-establish a new TCP connection when needed (to send another request), 
> and nothing should be lost.
> 
> On the other hand, if by "operations in progress" you mean that there 
> are requests being processsed and still not answered when you do the 
> restart, and Apache then drops the being-processed requests in the 
> middle, then indeed it is not very graceful.
> 
> 
> 
> dbezerra wrote:
>> There is no httpd -k graceful on Windows.
>> 
>>>From the Apache with Windows documentation:
>> 
>> "You can also tell Apache to restart. This forces it to reread the
>> configuration file. Any operations in progress are allowed to complete
>> without interruption. To restart Apache, use: httpd.exe -k restart"
>> 
>> The problem is that the above command is interrupting operations in
>> progress.
>> 
>> 
>> Gary W. Smith wrote:
>>> try 
>>>  
>>> httpd -k graceful
>>>  
>>> restart, by design, should stop and start the server, without regard to
>>> connections.
>>>  
>>> graceful reloads the config and then reloads each thread as it becomes
>>> inactive.
>>>  
>>> At least that's how it was put to me at a high level.
>>>  
>>> Gary
>>>
>>> ________________________________
>>>
>>> From: dbezerra [mailto:dbezerra@xxxxxxxxxxxxxxxx]
>>> Sent: Wed 1/28/2009 2:51 PM
>>> To: users@xxxxxxxxxxxxxxxx
>>> Subject:  httpd.exe -k restart command is closing
>>> connections
>>> on Windows
>>>
>>>
>>>
>>>
>>> When I use the command httpd.exe -k restart on Windows current HTTP
>>> connections are closed. Is this a bug? or by desing?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/httpd.exe--k-restart-command-is-closing-connections-on-Windows-tp21716966p21716966.html
>>> Sent from the Apache HTTP Server - Users mailing list archive at
>>> Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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@xxxxxxxxxxxxxxxx
>>>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>>
>>>
>>>
>>>
>>>
>> 
> 
> 
> ---------------------------------------------------------------------
> 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@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/httpd.exe--k-restart-command-is-closing-connections-on-Windows-tp21716966p21718792.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux