1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tuning FASTCGI / mod_fcgid settings from cPanel

Discussion in 'Workarounds and Optimization' started by actived, Apr 8, 2012.

  1. actived

    actived Member

    Joined:
    Mar 30, 2012
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    I recently changed to FAST CGI using the Apache module:
    Code:
    # This file was automatically generated by the Cpanel PHP Configuration system
    # ...
    
    # Fastcgi configuration for PHP5
    LoadModule fcgid_module modules/mod_fcgid.so
    MaxRequestsPerProcess 500
    AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
    ...
    FCGIWrapper ...
    # End of autogenerated PHP configuration.
    I get these errors now:
    Code:
    [warn] mod_fcgid: process 1234 graceful kill fail, sending SIGKILL
    [warn] [client x.x.x.x] mod_fcgid: read data timeout in 40 seconds
    [error] [client x.x.x.x] Premature end of script headers: page1.php
    [warn] mod_fcgid: process 1446 graceful kill fail, sending SIGKILL
    [warn] mod_fcgid: process 1447 graceful kill fail, sending SIGKILL
    [warn] [client x.x.x.x] mod_fcgid: read data timeout in 40 seconds
    [error] [client x.x.x.x] Premature end of script headers: page2.php
    [warn] mod_fcgid: process 1449 graceful kill fail, sending SIGKILL
    [warn] [client x.x.x.x] mod_fcgid: read data timeout in 40 seconds
    [error] [client x.x.x.x] Premature end of script headers: page3.php
    [warn] mod_fcgid: process 1451 graceful kill fail, sending SIGKILL
    Those often come in quick succession (about 50-100 of them inside 30-60 seconds)
    Even if I restart apache, the situation repeats after about 30-45 minutes.

    Sorry for dumb question, but using CPanel interface, where do I put the tuning parameters - PHP_FCGI_MAX_REQUESTS and PHP_FCGI_CHILDREN ?
    I have so far been unable to spot the option in Apache Configuration or PHP config sections.
    I increased the php.ini memory_limit to 384M (from 256M, where it was for a long time)

    Any other PHP/Apache tuning to be performed if this is a load issue?

    TIA,
    Dave
     
  2. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    You can add FCGI settings for those directives in /usr/local/apache/conf/includes/post_virtualhost_global.conf file. Once you've added the directives, please ensure to restart Apache.
     

Share This Page