1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Plesk, fcgi memory problems (leak?)

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by argonius, Jan 19, 2011.

  1. argonius

    argonius Basic Pleskian

    Apr 28, 2010
    Likes Received:

    we are running ~100 Domains on a Intel I7 CPU with 8GB of ram.
    After startup, the system has ~5GB of free ram. After a while, linux is taking much of them
    for caching, which is normal.

    Our domains are running with php in fcgi mode.

    After a while (~ 8h) I can see huge memory consumption from apache processes and many many
    old php processes.
    I played around with serveral fcgid.conf parameters, but without success.
    It seems that sometimes idle fcgi processes won't be killed :(

    here is my fcgid.conf:

    # added by psa-mod-fcgid-configurator
    LoadModule fcgid_module /usr/lib64/httpd/modules/mod_fcgid.so

    <IfModule mod_fcgid.c>
    SocketPath /var/lib/httpd/fcgid/sock

    # added by psa-mod-fcgid-configurator
    <IfModule mod_fcgid.c>
    IdleTimeout 600
    IdleScanInterval 240
    BusyTimeout 300
    BusyScanInterval 120
    ErrorScanInterval 6
    ZombieScanInterval 6
    ProcessLifeTime 3600
    SpawnScoreUpLimit 10
    SpawnScore 1
    TerminationScore 2
    MaxProcessCount 250
    DefaultMaxClassProcessCount 10
    DefaultMinClassProcessCount 0
    IPCConnectTimeout 30
    IPCCommTimeout 45
    DefaultInitEnv RAILS_ENV production

    Here are my settings for mpm_prefork (have to use prefork, cause
    webmail and others need mod_php ...)

    <IfModule prefork.c>
    StartServers 8
    MinSpareServers 5
    MaxSpareServers 20
    ServerLimit 256
    MaxClients 256
    MaxRequestsPerChild 4000

    I think, these value are acceptable.

    Does fcgid from psa has a memleak or something? Or has anybody a clue, how to get
    rid of old fcgi processes which aren't in use (i'd strace'd them)

    I am very thankful for any idea/help/guess ....

  2. fogelf

    fogelf Regular Pleskian

    Feb 10, 2010
    Likes Received:
    add new directivee in fcgid.conf

    <IfModule mod_fcgid.c>
    FcgidIdleTimeout 40
    FcgidProcessLifeTime 30
    FcgidMaxProcesses 20
    FcgidMaxProcessesPerClass 8
    FcgidConnectTimeout 30
    FcgidIOTimeout 45
    FcgidInitialEnv RAILS_ENV production
    FcgidIdleScanInterval 10
    FcgidMinProcessesPerClass 0 <<<<<<< without it timeouts are dummy
    </IfModule mod_fcgid.c>