Benutzer-Werkzeuge

Webseiten-Werkzeuge


mysql_tuning

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
mysql_tuning [2022-03-02 11:43:04] – [mysqltuner.pl] manfredmysql_tuning [2024-11-13 11:33:51] (aktuell) – [mysqltuner.pl funktioniert nicht mit PXC] manfred
Zeile 2: Zeile 2:
  
 siehe auch: siehe auch:
 +  * [[https://github.com/major/MySQLTuner-perl]]
 +    * ''> git clone https://github.com/major/MySQLTuner-perl.git''
 +    * ''> ls -1 MySQLTuner-perl/mysqltuner.pl''
 +    * ''MySQLTuner-perl/mysqltuner.pl''
   * [[::MySQL - Benchmark]]   * [[::MySQL - Benchmark]]
   * [[::MySQL-Lasttest]]   * [[::MySQL-Lasttest]]
Zeile 165: Zeile 169:
   query_cache_size= 512M   query_cache_size= 512M
   query_cache_type= 1   query_cache_type= 1
 +
  
  
Zeile 341: Zeile 346:
  
 ==== Performance Schema ==== ==== Performance Schema ====
 +
  
  
Zeile 406: Zeile 412:
  
   > perl mysqltuner.pl --defaults-file ~/.my.cnf 2>&1 | tee mysqltuner_-_$(date +'%F_%H-%M-%S').log   > perl mysqltuner.pl --defaults-file ~/.my.cnf 2>&1 | tee mysqltuner_-_$(date +'%F_%H-%M-%S').log
 +
 +
 +==== mysqltuner.pl funktioniert nicht mit PXC ====
 +
 +<code c Der Fehler>
 +# wget http://mysqltuner.pl/ -O mysqltuner.pl
 +# perl mysqltuner.pl --forcemem 8000000000 --forceswap 8000000000 --defaults-file /root/.my.cnf --defaults-extra-file /etc/mysql/conf.d_23357/my.cnf --port 23357
 + >>  MySQLTuner 2.5.3
 + * Jean-Marie Renouard <jmrenouard@gmail.com>
 + * Major Hayden <major@mhtx.net>
 + >>  Bug reports, feature requests, and downloads at http://mysqltuner.pl/
 + >>  Run with '--help' for additional options and output filtering
 +
 +[--] Skipped version check for MySQLTuner script
 +mysql: [ERROR] unknown option '--print-defaults'
 +mysql: [ERROR] unknown option '--print-defaults'
 +[--] Assuming 8000000000 MB of physical memory
 +[--] Assuming 8000000000 MB of swap space
 +[!!] Failed to execute: SELECT VERSION()
 +[!!] FAIL Execute SQL / return code: 1792
 +[!!] You probably do not have enough privileges to run MySQLTuner ...
 +</code>
 +
 +<code c Fehler nachstellen>
 +# /usr/bin/mysql --port 23357 --print-defaults
 +mysql: [ERROR] unknown option '--print-defaults'
 +</code>
 +
 +<code c Client-Ursprung ermitteln>
 +# dpkg -S mysql | grep -F bin | grep -E mysql$
 +percona-xtradb-cluster-client-5.7: /usr/bin/mysql
 +</code>
 +
 +<code c Der Grund steht in der Hilfe>
 +# /usr/bin/mysql --help
 +...
 +The following options may be given as the first argument:
 +--print-defaults        Print the program argument list and exit.
 +...
 +</code>
 +
 +<code c Test ist nicht befriedigend>
 +# /usr/bin/mysql --print-defaults --port 23357
 +/usr/bin/mysql would have been started with the following arguments:
 +--port=3306 --socket=/var/run/mysqld/mysqld.sock --host=localhost --user=root --password=***** --port 23357 
 +</code>
 +
  
 ===== Memory-Tabellen / Heap-Tables ===== ===== Memory-Tabellen / Heap-Tables =====
Zeile 429: Zeile 482:
      
   replicate_wild_ignore_table     = DatenbankName.%   replicate_wild_ignore_table     = DatenbankName.%
 +
 +
 +===== MyISAM-Tuning =====
 +
 +[[https://mariadb.com/kb/en/myisam-system-variables/|MyISAM System Variables]]
 +
 +prüfen, ob ''key_buffer_size'' richtig dimensioniert ist:
 +  > echo "SHOW STATUS LIKE '%key_read_requests%'; SHOW STATUS LIKE '%key_reads%';" | mysql -N | awk '{print $2}' | tr -s '\n' ' ' | awk '{a=$1 / $2; if (a < 100) A="katastrophal" ; if (a >= 100) A="akzeptabel" ; if (a >= 1000) A="gut" ; if (a >= 10000) A="sehr gut"; print "Wert ist",A,"("a")"}'
 +  Wert ist sehr gut (12570.9)
 +  
 +  > echo "SHOW STATUS LIKE '%key_reads%'; SHOW STATUS LIKE '%key_read_requests%';" | mysql -t
 +  +---------------+---------+
 +  | Variable_name | Value   |
 +  +---------------+---------+
 +  | Key_reads     | 1583133 |
 +  +---------------+---------+
 +  +-------------------+-------------+
 +  | Variable_name     | Value       |
 +  +-------------------+-------------+
 +  | Key_read_requests | 19943598300 |
 +  +-------------------+-------------+
 +
 +//key_buffer_size 25% or more of the available RAM (The ratio of ''key_reads'' to ''key_read_requests'' should be as low as possible, 1:100 is the highest acceptable, 1:1000 is better, and 1:10 is terrible.)//
  
  
/home/http/wiki/data/attic/mysql_tuning.1646221384.txt · Zuletzt geändert: von manfred