Skip to main content

Little Tuning Help Please

Comments

5 comments

  • rackaid
    Before diving into tuning MySQL, what makes you think it is a bottleneck? From your stats, I do not see any lock wait condition and buffer hit rates are high. I doubt you will see much improvement by adjusting your variables. I would start with adjusting the slow query time setting and log slow queries. Also, not sure why the system is calculating such high memory usage. Do you have have a high sort/read/join buffer sizes?
    0
  • Dradden45
    Right now it isn't a bottleneck, I was more after preventing it from becoming one if possible. There will be a bunch more sites and some woo-commerce stores being added in the near future.
    Also, not sure why the system is calculating such high memory usage. Do you have have a high sort/read/join buffer sizes?

    I believe these must be whatever MariaDB has as a default? There is nothing about these in the my.cnf, the only things listed there are what I listed in my original post.
    0
  • rackaid
    The script says you have 258.9M of memory configured in per-thread settings. I wonder if this is not a math error and this should be 258KB per thread. Regardless, I would not rely too much on these tools. One of the issues is that they are more designed for stand-alone database systems powering single applications/tenants. For example, the MyISAM index calculation is based on all MyISAM indexes. However, on a shared hosting system, you may find a lot of dormant databases. So the total MyISAM index size is not reflective of the actual indexes in use. I've seen people crank up their key_buffer to GBs but in fact only a handful of databases are in use at once. Pay attention to your cache hit rates and table locks. These will be the first items to show declines as you add more sites. Another common issue is that these scripts (and many tuning tutorials) suggest using InnoDB over MyISAM. However, the default on cPanel is MyISAM. (MyISAM is often better for backup/recover on shared hosting, but that is another matter). With MyISAM and the fact that most web apps are read intensive, enabling the query_cache can be beneficial. So if you were to tune one thing, I would enable the query_cache and set it to about 16MB. query_cache_type = 1 query_cache_size = 32M
    The query cache keeps recent SELECT statements in ram. With apps like shopping carts, discussion forums, etc, there are often many queries that can be cached. Enable the cache usually improves page response times though you may not see any appreciable improvements server side. Lastly, install the Munin plugin so you have more data to analyze as you begin to add more sites.
    0
  • cPanelLauren
    Beyond the great advice provided by @rackaid I'd suggest enlisting the assistance of a qualified system administrator. If you don't have one you might find one here: System Administration Services
    0
  • Dradden45
    @rackaid Thanks that is good information. I have a basic tune in it now and cache hit rate is better then it was, I think it is fine for now. I always install munin as part of server setup gives good information. To boost my dive back into this I am taking a couple Mysql / MaraiDB DBA courses, things are coming back fairly quick. @cPanelLauren If I need to rely on a server admin I probably should not be running any servers, I prefer to learn and do myself. But thank you for the advice :)
    0

Please sign in to leave a comment.