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:
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.
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
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.
Last edited by a moderator: