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 constantly appends 3 distinct values in modified /etc/my.cnf

Discussion in 'Database Discussion' started by fevangelou, Apr 25, 2018.

  1. fevangelou

    fevangelou Member

    Joined:
    Oct 10, 2010
    Messages:
    24
    Likes Received:
    5
    Trophy Points:
    53
    Location:
    Athens, Greece
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I've assembled (in collaboration with Percona in the past) an optimized /etc/my.cnf for cPanel servers:
    Optimized MySQL configuration for cPanel servers (updated July 2017)
    gist.github.com/fevangelou/0da9941e67a9c9bb2596

    It's one that a lot of cPanel admins use (most find it through the optimization guides I've written in the Engintron Wiki).

    What I've noticed (and also had reports about) is that cPanel will constantly append 3 distinct variables under the [mysqld] section (in my.cnf) EVEN if these values are already set:

    Code:
    innodb_buffer_pool_size=134217728
    max_allowed_packet=268435456
    open_files_limit=10000
    In my optimized my.cnf file I use hyphens instead of underscores. Even if I change that preference to use underscores, if I recall correctly at least "max_allowed_packet" will re-appear if you have a saner value set. So a regex is probably run in that file by cPanel and these 3 variables can be appended when you have a modified my.cnf.

    This really doesn't make any sense for 2 reasons.
    a) Why constantly patch my.cnf? If an admin has changed it, they probably know what they are doing.
    b) Even if they don't, the variables being appended are literally "whatever". innodb_buffer_pool_size is basically set to 128M which is pretty low, open_files_limit can be safely set at least 3 times that value & max_allowed_packet is set to 256M which is too high.

    I'd love some feedback/insights on this from the cPanel team.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 fevangelou, Apr 25, 2018
    Last edited by a moderator: Apr 25, 2018
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,961
    Likes Received:
    1,822
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @fevangelou,

    This is controlled with the following options under the "SQL" tab in "WHM >> Tweak Settings":

    Allow cPanel & WHM to determine the best value for your MySQL open_files_limit configuration?
    Allow cPanel & WHM to determine the best value for your MySQL max_allowed_packet configuration?
    Allow cPanel & WHM to determine the best value for your MySQL innodb_buffer_pool_size configuration?

    You can set these options to "Off" if you want to ensure they are not added to the /etc/my.cnf file upon each MySQL restart. Note that when enabled, these configuration values are added with underscores in the /etc/my.cnf file, and will take precedence over the existing values with hyphens.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. fevangelou

    fevangelou Member

    Joined:
    Oct 10, 2010
    Messages:
    24
    Likes Received:
    5
    Trophy Points:
    53
    Location:
    Athens, Greece
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    And being inside "Tweak Settings" means it can be programmatically configured as well :)

    Thank you @cPanelMichael!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelLauren and cPanelMichael like this.
Loading...

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