Skip to main content

PHP Websites unresponsive after 2-3 Hours?

Comments

11 comments

  • cPanelMichael
    Hello :) Do you notice any specific error messages in /usr/local/cpanel/logs/error_log when this happens? Thank you.
    0
  • razorif
    Thanks for your reply, After checking the cpanel error_log, I didn't find anything that is suspicious because the problems happens around 4-5 times a day and when looking through the log the only thing I found that is repeating is "[cpanel] Quotas are not enabled"... Also there's only 1 line (just 1) that says "Out of Memory!"
    0
  • razorif
    UPDATE: Checking httpd.conf I found something that MIGHT be the issue's origin: RLimitMEM 2836398080 RLimitCPU 240 Searching on Google about both directives, those are RAM and CPU limiters for any httpd process (as well as child forked processes). The memory limit directive is set to 2705MB and I have 32GB ram available. For the CPU limit, I didn't understand what 240 is exactly. Should I expand the RLimitMEM? or leave it like that?
    0
  • razorif
    I've removed those lines from the httpd conf file, but it still the same after a day of testing. I am now even getting httpd FAILED monitoring emails, and it's not auto recovering... Do you think there's something that is related the monitoring service? Maybe it's not able to restart the service when it's crashing?
    0
  • Infopro
    didn't install or modify anything server based (only some normal easyapache configs)

    What configs did you modify, exactly?
    0
  • razorif
    Nothing special, just added some extensions from the exhaustive list (like mbstring...) and rebuilt apache. But I didn't touch the httpd.conf file
    0
  • Infopro
    You could try selecting a "Basic Apache" profile in EasyApache, not change anything, and see if it builds and works properly. To troubleshoot.
    0
  • razorif
    I tried that already with many different modes (changing php version, apache basic profile...) still the same problem. By analyzing the apache error_log I found something repeating (same time when the down time happens): "[mpm_prefork:warn] [pid 13398] AH00167: long lost child came home! (pid 27478)" What does that line mean? Could it be the problem?
    0
  • Infopro
    Please feel free to open a ticket to cPanel Technical Support directly about this.
    0
  • razorif
    RESOLVED: If anyone is reading this and looking for how I solved this issue, here's what I did (thanks to cPanel Support): -I changed the Apache config like below: Start servers: 25 Minimum Spare Servers: 5 Maximum Spare Servers : 10 Server Limit: 1024 Max request workers (IMPORTANT): 1024 Max connections per child: 10000 Again, do this if only your primary website(s) are heavily loaded with traffic and php requests. Also only if you have enough RAM on installed on your server (for instance me I have 32GB, but I think the above config would work normally on even 6GB). -I also changed the PHP handler to Fcgi (fastcgi) because I have traffic heavy websites. -I changed the MPM from prefork to worker, as it helps reducing the Memory usage for php scripts and it is advised to use this MPM for heavy loaded websites (you can do this by going to Software->Apache 3->Customize and there from the exhaustive list option disable MPM Prefork and enable MPM Worker). -After all of the above, be sure to recompile the Apache and better reboot the server (so every single process would be killed for real). Now I have never encountered this problem again and apache is functioning since that time and never got a httpd crash or down time.
    0
  • cPanelMichael
    I am happy to see you were able to address the issue. Thank you updating this thread with the details of the solution. Thank you.
    0

Please sign in to leave a comment.