The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Configuring Opcache across multiple accounts

Discussion in 'General Discussion' started by hector_super, Apr 11, 2017.

Tags:
  1. hector_super

    hector_super Member

    Joined:
    Aug 4, 2016
    Messages:
    9
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    Hi,

    I have searched on Google and this forum with no luck, apologies if there's an answer to this already, I couldn't find it.

    I just provisioned PHP 7 and 7.1 on our dedicated server which hosts several accounts.

    Questions:

    1. Should the opcache settings be done at a global level on WHM's INI Editor? Or should they be done at an account level separately?

    2. Is it possible to allow/disallow specific accounts from using opcache?

    3. If settings are done globally and allow anyone on the server, is the code cached separately in each account's directory or is it mixed? If the latter, are there any security issues I should be aware of?

    4. If I run a GUI to monitor opcache, would I need one for PHP 7 and another one for PHP 7.1?


    Many thanks
     
  2. webhostuk

    webhostuk Well-Known Member

    Joined:
    Sep 11, 2013
    Messages:
    102
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    From what I understand I think you wish to enable opcache per account.
    To make things simple you need to first enable php-FPM for the account you wish to enable opcache , once php-FPM is on opcache will be on for that account.
    This action can also be enabled globally.

    For enabling php-FMP you need to do easyapache for particular version you select.

    Once php-FPM Enabled on the server you can handle its status per account thought WHM itself , search for php-FPM in WHM and then enable disble status per domain.

    For different versions of php you will have to independently enable opcache for that php Version.

    Hope this helps.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  4. hector_super

    hector_super Member

    Joined:
    Aug 4, 2016
    Messages:
    9
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    Thanks Michael and @webhostuk

    A few other questions about Opcache:

    1. Are the global settings, global? Meaning, is the 32MB (or whatever value) to be shared across all users or each user gets 32MB? Where are the cached scripts stored in the server?

    2. If I want to use a GUI such as github.com/PeeHaa/OpCacheGUI will it have to run from each user's directory or would I need a single global instance?

    3. Likewise, would the GUI mentioned in # 2 include stats for opcache across different versions of PHP or would I need to run one separate GUI per each version of PHP that has opcache enabled?
     
    #4 hector_super, Apr 12, 2017
    Last edited by a moderator: Apr 12, 2017
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    The following URLs explain how Opcache works in more detail:

    OpCache - understanding how the cache works, per user or per resource?
    PHP Performance I: Everything You Need to Know About OpCode Caches

    This thread offers some more details you may find helpful as well:

    SOLVED - Zend OPcache and PHP-FPM

    I believe the following feature request covers how the existing setup with OPCache works (shared per each PHP version):

    Zend Opcache User Interface for WHM / cPanel - (with separate cache's for each cpanel account)

    Thank you.
     
  6. hector_super

    hector_super Member

    Joined:
    Aug 4, 2016
    Messages:
    9
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    Thanks @cPanelMichael

    I have read the links you sent and the last one (Feature Request) mentions what I believe is my solution:

    Zend Opcache User Interface for WHM / cPanel - (with separate cache's for each cpanel account)

    I run Litespeed. So to confirm: could I operate entirely separate opcaches, each per user, to avoid file collisions and one user peeking into the other's files etc? Is this something I should discuss with LS or do you have some recommendations / instructions how to do that? If I do it through Litespeed:

    1. Would each user have their separate memory allocation for their caches?
    2. Would a GUI (such as OpCacheGUI) run locally on each account without affecting others?
    3. Would I be able to enable/disable opcache per account, even if they all used the same version of PHP?

    Many thanks
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  8. hector_super

    hector_super Member

    Joined:
    Aug 4, 2016
    Messages:
    9
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    cPanelMichael likes this.
Loading...

Share This Page