5

if I have large file downloads served with apache server, is there a way to restart/reload the http server(eg. with new httpd.conf update) without interrupting ongoing file downloads? or at least provide a way for clients to resume downloads?

7

A normal download happens in a single tcp connection, there is no 'generic' way to restart apache and maintain that single connection.

BUT if you run

apachectl -k graceful

or if you send a USR1 signal to your apache master process, then it will reload gracefully, this means that it will complete serving the requests currently in progress and then reload.

On the http protocol level it is possible to request just part of a file.

The client can send a HEAD request for the given file to the server. If the server responds with Accept-Ranges: bytes and a Content-Length header, the client can then proceed to send a GET request using a Range: bytes=... header to receive whichever part of the file it wants. The server will respond with partial content of the file and put a 206 status on its response.

Internet Explorer and Firefox are known to do this for normal downloads when you ask the browser to resume a download.

  • so a graceful restart will likely not cause any interruption if downloads are done via browser, right? what about wget? would it be interrupted? – user12145 Mar 21 '15 at 21:42
  • with graceful restart, downloads should not get interrupted at all, regardless of who is downloading. – Tobi Oetiker Mar 22 '15 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.