June 19, 2013

Post: Rotating MySQL slow logs safely

… daemon to be signaled to reopen its log file. MySQL has a mutex for slow log writes. Truncation can block MySQL because the OS serializes access… file system (instead of xfs). Use FLUSH LOGS instead of sending SIGHUP When copytruncate is disabled, MySQL must be told to reopen the slow log file

Comment: Rotating MySQL slow logs safely

…, the slow logs are disabled in the postrotate stanza. The order of operations is: 1. logrotate renames the log file. MySQL continues to write to the renamed file because it has not yet reopened the file. 2. logrotate runs the postrotate stanza 2a. Slow logging

Post: Innodb vs MySQL index counts

… from the number of indexes 7 defined in the MySQL This customer was running Percona Server 5.1 and… the entire Innodb Data dictionary to the mysqld error log file. If I had to do it over again, I …, table2; to force the tables to close and be reopened and simply see if the error message comes back.  …

Post: Be careful rotating MySQL logs

… filesystem and log file size – we’ve seen it to take 10 minutes or more in some cases. When log file is reopened MySQL will be practically unavailable causing unanticipated downtime. The workaround for this problem is very simple – instead of deleting MySQL log file

Post: MySQL File System Fragmentation Benchmarks

… 100 1000 10000; do ./benchmark.php $i 10000000; mysql -e’drop database test1′; mysql -e’create database test1′; done; tables: 1; total… MySQL settings for MyISAM (table_cache=64) and set innodb_buffer_pool_size=8G innodb_flush_logs_at_trx_commit=2 innodb_log_file… is perhaps explained by the fact files needed to be constantly extended (meta data updates) and reopened for more than 100 tables…

Post: Enabling/Disabling query log without server restart in MySQL 5.0

General query logging can be very handy in MySQL on profuction server for various debugging needs. Unfortunately you can’… on and off without restarting server until MySQL 5.0. What can you do in MySQL 5.0 and below ? Use Our… it to something else and run “flush logs” so logs are reopened and written to the file in question. When you have debug info…