Coder Social home page Coder Social logo

releem / mysqlconfigurer Goto Github PK

View Code? Open in Web Editor NEW
236.0 12.0 24.0 72.91 MB

Releem is a simple MySQL tuning tool to improve database performance and reduce servers costs.

Home Page: https://releem.com

License: GNU General Public License v3.0

Shell 35.20% Dockerfile 0.72% Smarty 1.76% Go 62.31%
mysql aiops performance-tuning mysql-performance mysql-server mysqltuner percona-server mariadb mariadb-performance performance-optimization

mysqlconfigurer's People

Contributors

dependabot[bot] avatar drupaladmin avatar kochetovd avatar ragowit avatar vistar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mysqlconfigurer's Issues

Display what has changed

Maybe at the bottom add a comment of what has changed

changed

table_open_cache = 512 ### Previous value : 431

table_definition_cache = 640 ### Previous value : 524288

Add disclaimer from MySQLTuner

It is extremely important for you to fully understand each change you make to a MySQL database server. If you don't understand portions of the script's output, or if you don't understand the recommendations, you should consult a knowledgeable DBA or system administrator that you trust. Always test your changes 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. In fact, running mysqltuner on a fresh restarted server is completely useless.

Do not download MySQLTuner every time

И еще — понятно, что это не ваш баг, но mysqltuner пытается получить данные через hostname -I. Проблема в том, что у меня на сервере hostname не понимает -I, ему вместо этого надо дать -i. Вручную подправить две строчки в скрипте — не проблема, но он каждый раз скачивается заново. Это действительно необходимо — каждый раз качать сторонний скрипт?

Exclude "MySQL client" information

Exclude "MySQL client" information from MySQLTuner JSON report, because it could contain password which user input manually. And it don't contain password if you use file with mysql credentials.

Recommendation innodb_buffer_pool_size to more than RAM is available

MySQLTuner recommendation to set the value of innodb_buffer_pool_size to more than RAM is available
Example:
cat .mysqlconfigurer/z_aiops_mysql.conf
...
innodb_buffer_pool_size = 3019898880 ### Previous value : 1073741824
...

free -h
total used free shared buffers cached
Mem: 4.0G 3.7G 327M 87M 60M 1.3G
-/+ buffers/cache: 2.3G 1.7G

Не верные значения параметров

Параметр innodb_buffer_pool_instances должен быть равен целому количеству ГБ в innodb_buffer_pool_size.
Из рекомендаций mysqltuner можно добавить установку параметров:

  1. table_definition_cache - Оставлять по умолчанию если не требуется увеличение
  2. innodb_log_file_size - 25% от innodb_buffer_pool_size

Values too high

Your service is recommending these changes as the last ones:
table_definition_cache=2218496 ### Previous value =524288
table_open_cache=4436224 ### Previous value =19745

And we had them updated for 3 nights in a row but they were never effective.

Now a supporter found that it was because they were too high for MySQL 8.

parameters for different server profiles

Add parameters for generate config with different innodb_flush_log_at_trx_commit values. Because for some servers critical to set value - 0, but for some servers you could use value - 2.

500 Internal Server Error

Hello!
I tried to use your script, but as a result I got file z_aiops_mysql.cnf
# 500 Internal Server Error Oh no! Something bad happened. Please check supported MySQL versions. Thanks.
To be sure I checked MySQL version.
$ mysql -v
.......
Server version: 5.5.65-MariaDB MariaDB Server

And then I checked the length of mysqltuner report - it's non empty.
-rw-r--r--. 1 adm77807 domain users 30535 Apr 29 14:00 mysqltunerreport.json

Could you help me, please?
Thanks!
Aleksey B.

Do not execute request to API when MySQLTuner returns error

When the MySQLTuner use invalid credentials it returns message:

MySQLTuner 1.7.19 - Major Hayden [email protected] >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with ‘--help’ for additional options and output filtering[OK] You have the latest version of MySQLTuner(1.7.19)[!!] Attempted to use login credentials, but they were invalid.

And when that message send to api.support-servers.com as result we have Internal server error

Can't locate Data/Dumper.pm on Centos

[root@vm147000 ~]# /bin/bash mysqlconfigurer.sh
Can't locate Data/Dumper.pm in @inc (@inc contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /tmp/.mysqlconfigurer/mysqltuner.pl line 52.
BEGIN failed--compilation aborted at /tmp/.mysqlconfigurer/mysqltuner.pl line 52.

Is there any way to skip SSL certificate in the bash script?

root@sud:~# wget https://raw.githubusercontent.com/initlabopen/mysqlconfigurer/master/mysqlconfigurer.sh --2020-03-11 19:17:12-- https://raw.githubusercontent.com/initlabopen/mysqlconfigurer/master/mysqlconfigurer.sh Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.112.133 Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.112.133|:443... connected. ERROR: The certificate of ‘raw.githubusercontent.com’ is not trusted. ERROR: The certificate of ‘raw.githubusercontent.com’ hasn't got a known issuer.

`root@sud:~# curl -o mysqlconfigurer.sh https://raw.githubusercontent.com/initlabopen/mysqlconfigurer/master/mysqlconfigurer.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.`

I think I might have a problem with local issuer certificates, but reinstalling ca-certificates didn't help me.

Improve guide

Can you improve your guide so it includes text about where to place the optimized MySQL file if you are using a CentOS 7 server?

We had different supporters at Hosting company doing the different moving-ins of the optimized MySQL files over a period of days but the last 2 nights/early mornings the same supporter moved the optimized files into the “wrong” folder (but “right” folder following your guide). The other supporters known about the real folder for MySQL when using CentOS 7 but this supporter had not and our points stayed at 70 after 2 optimizations.

Variable calculation max_connections

Change the value of the max_connections variable if max_connections is slightly larger or equal to the value of the Max_used_connections status variable.

Add old values to configuration file

The configuration file contains new values for the mysql variables. But I want to see old values which we plan to change.

Please add old values as comments for variables.

Нужно предупреждение об изменении innodb_log_file_size

Так просто нельзя же менять значение innodb_log_file_size. Это может повлечь проблемы с рестартом сервера. Нужны какие-то инструкции и рекомендации как правильно скорректировать это, чтобы не попасть впросак вам как сервису

WHM panel plugin

It could be extremely good if make a WHM plugin so we could do the optimization from the WHM having optimize and rollback buttons there.

Recommendation for table_definition_cache causes MariaDB to malfuntion

There is an unresolved bug in MariaDB regarding table_definition_cache:
https://jira.mariadb.org/browse/MDEV-17124

It casues some web applications to throw error:

General error: 1615 Prepared statement needs to be re-prepared

This is z_aiops_mysql.cnf which made the bug appear in my environments:

[mysqld]
query_cache_type = 1 ### Previous value : OFF
query_cache_size = 128M ### Previous value : 0
query_cache_limit = 16M ### Previous value : 4194304
thread_cache_size = 256 ### Previous value : 256
key_buffer_size = 2147483648 ### Previous value : 2147483648
sort_buffer_size = 24M ### Previous value : 2097152
bulk_insert_buffer_size = 2M ### Previous value : 8388608
myisam_sort_buffer_size = 24M ### Previous value : 134216704
innodb_buffer_pool_instances = 1 ### Previous value : 3
innodb_buffer_pool_size = 2013265920 ### Previous value : 3221225472
max_heap_table_size = 256M ### Previous value : 268435456
tmp_table_size = 256M ### Previous value : 268435456
join_buffer_size = 8M ### Previous value : 25165824
max_connections = 256 ### Previous value : 256
interactive_timeout = 1200 ### Previous value : 12800
wait_timeout = 1200 ### Previous value : 12800
table_open_cache = 2048 ### Previous value : 2000
table_definition_cache = 1408 ### Previous value : 2048
innodb_flush_log_at_trx_commit = 2 ### Previous value : 1
innodb_log_file_size = 251658240 ### Previous value : 419430400
innodb_write_io_threads = 4 ### Previous value : 4
innodb_read_io_threads = 4 ### Previous value : 4
innodb_buffer_pool_chunk_size = 134217728 ### Previous value : 134217728`

Changing table_definition_cache to 2048 seems to fix the bug.

Not all settings apply

Sometimes, if you put the file in /etc/mysql/conf.d/z_aiops_mysql.cnf, then not all settings apply. This happens when the same settings are made in the files from the /etc/mysql/mysql.conf.d/ folder, because files from it are included later.

Rename file z_aiops_mysql.conf

Need to rename file z_aiops_mysql.conf -> z_aiops_mysql.cnf
After performing the steps from point 4, the new settings are not applied. The reason for this problem is that mysql uses the .cnf file extension.

Display timezone on server page

The data collected is from just before the mysql service is restarting (if your portal is displaying in the time zone CET which it does not say).

image005

The MySQL service was restarted at 01:00 CET but hopefully later today it will update the matrics and we know that we have got accurate stats now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.