Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cPanel server performance optimization

Discussion in 'Workarounds and Optimization' started by joomla, Sep 25, 2014.

  1. joomla

    joomla Well-Known Member

    Jul 23, 2014
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    I set server by using Igor Seletskiy blog, where he describes how fcgid and opcode cachers works. I will citate:

    Lets first explore how mod_fcgid works:
    When request comes in for PHP, mod_fcgid checks if there is idle php process available for that user. If there is none, it starts a new one (up to FCGIDMaxProcessesPerClass, default 100). The request is served, and php process becomes idle. Until next request comes in.

    Lets now add opcode caching, like eAccelerator, APC or xCache. Opcode caching software saves opcode (php pre-compiled into "operation code" ) into shared memory. Next time it has to process same PHP file, PHP process would not compile php, using opcode from cache instead.That will significantly decreasing CPU usage, and improving performance.

    PHP processes with opcode cache enabled use shared memory for opcode caching. Yet, PHP processes will be able to "share" that shared memory, only if they were all created (forked) from the same, original PHP process, that allocated that shared memory.

    This is not the case with mod_fcgid, as each and every PHP process is started by mod_fcgid itself. As the result, they don't "share" shared memory. In this case. each PHP process has its own shared memory, amd no opcode is shared between processes.

    So, if process A is responding for request for index.php, and process B is responding to request for index.php, each of them will store its own copy of opcode in its own cache.

    Yet, on the second request for index.php to process A, that process can use cached opcode. Gven that single PHP process can process thousands of requests -- opcode caching is useful with mod_fcgid.

    Here are all clear. I choosed fastcgi and eaccelerator and set values.

    But I included mod_expire settings and mod_deflate settings for all server accounts by using Pre virtual host include, global conf. This settings are as follow:

    # Cache Control Settings for one hour cache
    <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    Header set Cache-Control "max-age=3600, public"

    <FilesMatch ".(xml|txt)$">
    Header set Cache-Control "max-age=3600, public, must-revalidate"

    <FilesMatch ".(html|htm)$">
    Header set Cache-Control "max-age=3600, must-revalidate"

    # Mod Deflate performs data compression
    <IfModule mod_deflate.c>
    <FilesMatch ".(js|css|html|php|xml|jpg|png|gif)$">
    SetOutputFilter DEFLATE
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE no-gzip

    I understand how fastcgi and eaccelerator works. But, is not clear to me how mod expire and mod deflate interact with these settings. Does mod expire and mod deflate I set globally could speed down Web pages load in some cases, or break fastcgi and eaccelerator to work properly.

    After first request for example index.php and fcgid proces, and after second request for index.php and eaccelerator proces, how mod_expire and mod_deflate interact in this combination.

    Many thank you for your time and wish to help me! :)
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice