Whenever you install your favorite MySQL server on a freshly created Ubuntu instance, you start by updating the configuration for MySQL, such as configuring buffer pool, changing the default datadir director, and disabling one of the most outstanding features – query cache. It’s a nice thing to do, but first things first. Let’s review the best practices we usually follow in Managed Services before using your MySQL server in production and stage env, even for home play purposes.
Memory
Our usual recommendation is to use specific memory parameters, which we suggest to ensure optimal performance.
- To prevent out-of-memory (OOM) episodes, the OOM Score has to be set to -800.
- vm.swappiness = 1
- Disable Transparent Huge Pages
- Install and enable jemalloc. Let’s briefly go through each setting to understand why adjustments are needed. Afterward, we will see how to configure these …