All Projects → Releem → Mysqlconfigurer

Releem / Mysqlconfigurer

Licence: gpl-3.0
Releem MySQL Configurer is a tool that will assist you with MySQL performance tuning. Releem is an online service for automatic optimization MySQL configuration to improve performance and reduce costs.

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Mysqlconfigurer

Pinba2
Pinba2: new implementation of https://github.com/tony2001/pinba_engine
Stars: ✭ 101 (-0.98%)
Mutual labels:  mysql, mariadb
Tbls
tbls is a CI-Friendly tool for document a database, written in Go.
Stars: ✭ 940 (+821.57%)
Mutual labels:  mysql, mariadb
Jale
Jale is a blazing fast local development environment for MacOS written in Typescript.
Stars: ✭ 24 (-76.47%)
Mutual labels:  mysql, mariadb
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (+7460.78%)
Mutual labels:  mysql, mariadb
Ebean
Ebean ORM
Stars: ✭ 1,172 (+1049.02%)
Mutual labels:  mysql, mariadb
Ansible Role Mysql
Ansible Role - MySQL
Stars: ✭ 826 (+709.8%)
Mutual labels:  mysql, mariadb
Skeema
Schema management CLI for MySQL
Stars: ✭ 859 (+742.16%)
Mutual labels:  mysql, mariadb
Phpmyadmin
A web interface for MySQL and MariaDB
Stars: ✭ 5,750 (+5537.25%)
Mutual labels:  mysql, mariadb
Dbbench
🏋️ dbbench is a simple database benchmarking tool which supports several databases and own scripts
Stars: ✭ 52 (-49.02%)
Mutual labels:  mysql, mariadb
Mysqldump Php
PHP version of mysqldump cli that comes with MySQL
Stars: ✭ 975 (+855.88%)
Mutual labels:  mysql, mariadb
Mycat2
MySQL Proxy using Java NIO based on Sharding SQL,Calcite ,simple and fast
Stars: ✭ 750 (+635.29%)
Mutual labels:  mysql, mariadb
Dockerweb
A docker-powered bash script for shared web hosting management. The ultimate Docker LAMP/LEMP Stack.
Stars: ✭ 89 (-12.75%)
Mutual labels:  mysql, mariadb
Sequelize
An easy-to-use and promise-based multi SQL dialects ORM tool for Node.js
Stars: ✭ 25,422 (+24823.53%)
Mutual labels:  mysql, mariadb
Mariadb Container
MariaDB container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 19 (-81.37%)
Mutual labels:  mysql, mariadb
Sqlancer
Detecting Logic Bugs in DBMS
Stars: ✭ 672 (+558.82%)
Mutual labels:  mysql, mariadb
Mysqlconnector
Async MySQL Connector for .NET and .NET Core
Stars: ✭ 942 (+823.53%)
Mutual labels:  mysql, mariadb
Mariadb4j
MariaDB Embedded in Java JAR
Stars: ✭ 579 (+467.65%)
Mutual labels:  mysql, mariadb
Dbshield
Database firewall written in Go
Stars: ✭ 620 (+507.84%)
Mutual labels:  mysql, mariadb
Wait4x
Wait4X is a cli tool to wait for everything! It can be wait for a port to open or enter to rquested state.
Stars: ✭ 30 (-70.59%)
Mutual labels:  mysql, mariadb
Aiomysql
aiomysql is a library for accessing a MySQL database from the asyncio
Stars: ✭ 1,252 (+1127.45%)
Mutual labels:  mysql, mariadb

Releem MySQLConfigurer

Build Status - Master

Description

MySQLConfigurer is a script that will assist you prepare performance optimized configuration of your MySQL server based on the MySQLTuner report (MySQL status and system information).

Releem is an online service for automatic optimization MySQL configuration to improve performance and reduce costs. Releem analyzes the MySQLTuner report, MySQL status and system information of your server and provides settings recommendations in the form of a MySQL configuration file.

To get your Releem API Key please sign up.

Support

Join the Releem Community on Slack and Telegram.

Features

  • Fully automated MySQL performance configuration tuning.
  • MySQLConfigurer recommended configuration deliver a 30% boost to MySQL performance compare to the default configuration.
  • MySQLConfigurer supports 25 parameters of MySQL/Percona/MariaDB server.
  • Using MySQLConfigurer you can prepare configuration file for your MySQL server just in 60 seconds.
  • You could use MySQLConfigurer to getting the recommended values for your server and insert in your configuration.

Warning

Always test recommended configuration on staging environments, and always keep in mind that improvements in one area can negatively affect MySQL in other areas.

It's also important to wait at least a day of uptime to get accurate results.

Security

Always store credentials only in ~/.my.cnf to prevent sending passwords to our service. In other cases MySQLTuner stores passwords manualy entered while running script in "MySQL Client" section of the MySQLTuner report.

To use .my.cnf file create file ~/.my.cnf with folowing content:

[client]
user=root
password=[your password]

Compatibility

  • MySQL 8.0
  • MySQL 5.7
  • MySQL 5.6
  • MySQL 5.5
  • MariaDB 10.1
  • MariaDB 10.2
  • MariaDB 10.3
  • MariaDB 10.4
  • MariaDB 10.5

*** MINIMAL REQUIREMENTS ***

  • Perl 5.6 or later (with perl-doc package)
  • Perl module JSON
  • Unix/Linux based operating system (tested on Linux, BSD variants, and Solaris variants)
  • Unrestricted read access to the MySQL server (OS root access recommended for MySQL < 5.1)

Technical details

MySQLConfigurer is a Bash script which

  1. downloads last version of the MySQLTuner
  2. runs MySQLTuner with options "--json --verbose --notbstat"
  3. uploads MySQLTuner report in the JSON to Releem online service https://api.servers-support.com/v1/mysql
  4. downloads recommended MySQL config file

Tests

We tested the results with Sysbench on a virtual server running Debian 9 (2 CPU, 2GB Ram) the table contained 10 million entries. Two configurations were tested, the MySQL default configuration and the configuration recommended by the Releem service. The tests were two-step: read (test1) only and read/write (test2).

Recommended configuration delivered a 30% boost to MySQL performance compared to the default configuration. Follow this link to see test results.

Options

-k [Releem API KEY] - API Key to Releem platform. To get your Releem API Key please sign up.

-m [MYSQL_MEMORY_LIMIT] - set maximum memory limit for MySQL. Used when there are installed different applications on the server.

Installation

One step installation to /opt/releem

    RELEEM_API_KEY=[YOUR_RELEEM_API_KEY] bash -c "$(curl -L https://releem.s3.amazonaws.com/install.sh)"

Usage

  1. To run mysqlconfigurer.sh execute folowing command

    /bin/bash /opt/releem/mysqlconfigurer.sh -k [RELEEM_API_KEY]
    
    • Use -m [MYSQL_MEMORY_LIMIT] - to set maximum memory limit for MySQL. Used when there are different applications installed on the server.
    • RELEEM_API_KEY - To get your Releem API Key please sign up.
  2. Recommended MySQL configuration file is /tmp/.mysqlconfigurer/z_aiops_mysql.cnf

  3. Only if you need to increase open_files_limit variable. Perform the folowing steps to safely setup open_files_limit in MySQL

    3.1. Find out if any other .conf files are being used with MySQL that overrides the values for open limits. Run systemctl status mysqld/mysql/mariadb command and it will show something like this

        Drop-In:
            /etc/systemd/system/(mysqld/mysql/mariadb).service.d
            └─limits.conf
    

    This means there is /etc/systemd/system/(mysqld/mysql/mariadb).service.d/limits.conf file which is loaded with MySQL Server. If this file does not exist, you should create create it.

    mysqld/mysql/mariadb is selected depending on the name of the running service name on the server, which is also defined in the output of the command systemctl status mysqld/mysql/mariadb

    3.2. Edit the file and add the following and change [table_open_cache] to your value

        [Service]
        LimitNOFILE=([table_open_cache] * 2)
    
    • open_files_limit should be no less than [table_open_cache] * 2.

    3.3. Run the following command to apply the changes. systemctl daemon-reload

    3.4. Reboot your mysql server.

    3.5. After the successful reboot of the server, we will again run below SQL Queries.

        SHOW VARIABLES LIKE 'open_files_limit';
    

    You should see the following:

        +------------------+--------+
        | Variable_name    | Value  |
        +------------------+--------+
        | open_files_limit | 102400 |
        +------------------+--------+
        1 row in set (0.00 sec)
    
  4. Perform the following steps to safely apply recommended configuration:

    WARNING! In case of change 'innodb_log_file_size' only in MySQL 5.6.7 or earlier set parameter 'innodb_fast_shutdown' to 1 (Official documentation), stop MySQL server, copy old log files into a safe place and delete it from log directory, copy recommended configuration and start MySQL server:

        mysql -e"SET GLOBAL innodb_fast_shutdown = 1"
        service mysql stop
        cp /tmp/.mysqlconfigurer/z_aiops_mysql.cnf  /etc/mysql/conf.d/
        mv /var/lib/mysql/ib_logfile[01] /tmp
        service mysql start
    

    In other cases stop MySQL server, copy recommended configuration file and start MySQL server:

        service mysql stop
        cp /tmp/.mysqlconfigurer/z_aiops_mysql.cnf  /etc/mysql/conf.d/
        service mysql start
    
    • The path to /etc/mysql/conf.d folder can vary according to Linux distro.

Example of the recommended configuration file /tmp/.mysqlconfigurer/z_aiops_mysql.cnf:

[mysqld]
query_cache_type = 1 ### Previous value : ON
query_cache_size = 128M ### Previous value : 134217728
query_cache_limit = 16M ### Previous value : 16777216
thread_cache_size = 8 ### Previous value : 8
key_buffer_size = 205520896 ### Previous value : 205520896
max_allowed_packet = 1073741824 ### Previous value : 67108864
sort_buffer_size = 16777216 ### Previous value : 25165824
read_rnd_buffer_size = 4194304 ### Previous value : 4194304
bulk_insert_buffer_size = 8M ### Previous value : 2097152
myisam_sort_buffer_size = 8388608 ### Previous value : 25165824
innodb_buffer_pool_instances = 2 ### Previous value : 3
innodb_buffer_pool_size = 3019898880 ### Previous value : 3019898880
max_heap_table_size = 256M ### Previous value : 268435456
tmp_table_size = 256M ### Previous value : 268435456
join_buffer_size = 8M ### Previous value : 8388608
max_connections = 151 ### Previous value : 151
table_open_cache = 3072 ### Previous value : 3072
table_definition_cache = 1920 ### Previous value : 1920
innodb_flush_log_at_trx_commit = 2 ### Previous value : 2
innodb_log_file_size = 377487360 ### Previous value : 805306368
innodb_write_io_threads = 4 ### Previous value : 4
innodb_read_io_threads = 4 ### Previous value : 4
innodb_file_per_table = 1 ### Previous value : ON
innodb_flush_method = O_DIRECT ### Previous value :
innodb_thread_concurrency = 0 ### Previous value : 0

Contribute

You can help this project by reporting problems, suggestions or contributing to the code.

Report a problem or suggestion

Go to our issue tracker and check if your problem/suggestion is already reported. If not, create a new issue with a descriptive title and detail your suggestion or steps to reproduce the problem.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].