SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2009
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Apache graceful restart - Does it affect current PHP script execution

    I had been reading about Apache graceful restart.

    Code:
    apachectl -k graceful
    http://httpd.apache.org/docs/2.2/stopping.html#graceful
    The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they're not serving anything).
    http://www.electrictoolbox.com/artic...estart-apache/
    ...meaning that anyone who is in the middle of downloading something will continue to be able to download it.
    If a long running PHP script is currently being executed (eg: processing a large image), will graceful restart allow it to be completed or will it hinder its execution?

  2. #2
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,547
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    I'd presume if you have php as an apache module you'd be ok, however if you have php as CGI you might interrupt it. If I ever have any heavy image processing, I tend to prefer imagemagick as the method of carrying it out as apart from being more advanced, it then exists outside php/apache limitations.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2009
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the reply

    I'm using imagemagick.

    If you find out more about this, please post

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,644
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Anish,

    Since it is Apache which is handling requests (Apache asks PHP for help when required but receives the output from PHP to send back to the requester), I'd GUESS that forcing a restart will terminate any and all ongoing processes. That said, the short time that Apache takes to restart (assuming no adverse impace from the changes you made to its configuration files which are requiring the restart are syntactically valid), any disruption in service should be minimal (even on a busy server).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •