Skip to main content

Tracking down the cause of apache hanging processes

Comments

5 comments

  • cPanelLauren
    . Why aren't these processes killed off automatically (be it max_execution_time or something else)?

    They aren't being killed off automatically because they're sitting in W - this is a coding issue
    . What command can I use to find the last script file, PHP code, DB query, that was executed on that process that caused the hang.

    I don't think you'll be able to get that detailed with lsof -p but you might try strace to see the specific system calls.
    0
  • Gareth-AWD
    Thanks, but with regard to the first point about being a coding issue. We switched to from suphp to fcgi and the problem went away suddenly. Surely if it was a coding issue, this wouldn't be the case.
    0
  • cPanelLauren
    Hi @Gareth-AWD Because FCGID has a different process handling method it may cover up the fact that connections weren't closing properly before. So the problem is most likely still there, just fcgid helps keep it maintainable due to its own configuration. I am glad though to hear things are resolved for you now. You can read in more depth about fcgid here: mod_fcgid - Apache HTTP Server Version 2.5 Thanks!
    0
  • Gareth-AWD
    Hi Lauren, Thanks for clarifying it. Obvious concerned there may be an issue in the code somewhere. The code does check and create a new folder on the system with PHP mkdir and chmod, this is the only thing I can think of that may cause a wait issue? Is that something that may cause such an issue. It does odd thought the same code running on another server with suPHP does not exhibit the issue.
    0
  • cPanelLauren
    Hi @Gareth-AWD My assumption based solely on the description of the issue is that it sounds a lot like the connections aren't being closed properly, this would leave them in the W state and is almost always a coding issue. If you're using the same code on a different server with the same configuration then it is quite possible it could be something entirely different. To find out though you'd most likely want to involve your system administrator. If you think it's something specific to cPanel, please feel free to open a ticket and add both the working + non-working servers so we can compare.
    0

Please sign in to leave a comment.