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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

OpCache Tuning

Discussion in 'Workarounds and Optimization' started by Droidism20011, Aug 3, 2017.

Tags:
  1. Droidism20011

    Droidism20011 Member

    Joined:
    Jul 20, 2017
    Messages:
    23
    Likes Received:
    10
    Trophy Points:
    3
    Location:
    Amsterdam
    cPanel Access Level:
    Root Administrator
    Hi,

    I am trying to get some reasonable performance out of my WHM/cPanel/Cloudlinux/mod_lsapi VPS.

    At the moment I am trying to configure opcache for PHP7.1

    The plan is to host WordPress websites, and the occasional static HTML/JS site, nothing else.

    Here is what I got thus far:

    opcache:
    opcache.fast_shutdown=0*

    Result:
    Code:
    used_memory    17.45 MB
    free_memory    110.55 MB
    
    num_cached_scripts    782
    num_cached_keys    802
    max_cached_keys    7,963
    opcache_hit_rate 2.49%
    
    Misses 782
    Cache Hits 20
    The biggest opcache memory consumers are WooCommerce, followed by GravityForms. Both have 0 hits. (???)

    Does anyone have any idea's or suggestions as to why the opcache hit/miss difference is this big?

    As a side note: I also set PHP's realpath caching with the following numbers:
    set realpath_cache_size = 64k
    set realpath_cache_ttl = 3600

    Result:
    var_dump(realpath_cache_size());
    Code:
    int(902)
    I am convinced that the cache_size could be lowered, but running WP I rather start a bit to high and then do incremental decreases until I hit the mark.

    *set deliberate to 0 to avoid memory corruption in strings (remember: WP and it's many themes and plugins, some great, some less great.)

    Thanks in advance for any answers and/or suggestions.

    W.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Here is a thread that offers some information you may find helpful:

    Configuring Opcache across multiple accounts

    You may want to also post this question on a website such as StackOverflow if you don't receive sufficient user-feedback here.

    Thanks!
     
    Droidism20011 likes this.
  3. Droidism20011

    Droidism20011 Member

    Joined:
    Jul 20, 2017
    Messages:
    23
    Likes Received:
    10
    Trophy Points:
    3
    Location:
    Amsterdam
    cPanel Access Level:
    Root Administrator
    @cPanelMichael

    Hi,

    Thanks again for your help. Great information that has gotten me somewhere!

    Also, SO is nice and I will try and see what feedback i can get from the great people there.

    Have a great day!

    W.
     
    cPanelMichael likes this.
Loading...

Share This Page