MySQL Performance Tuning Primer Script

上一篇 / 下一篇  2008-03-07 16:09:55 / 个人分类:LAMP

MySQL Performance Tuning Primer Script

木铎校园 BBS 社区.B*^ejX7QL*V?1r

This script takes information from "SHOW STATUS LIKE..." and "SHOW VARIABLES LIKE..."
$eX }(@1g4P,a'gu0to produce sane recomendations for tuning server variables.
1X Q"dvH4a0y$c0bA0It is compatable with all versions of MySQL 3.23 and higher (including 5.1).
7K5K$lVAC3W;W0木铎校园 BBS 社区Q}0} p-e6v?H,d

OR-zf ^0Currently it handles recomendations for the following:

  • Slow Query Log
  • Max Connections
  • Worker Threads
  • Key Buffer
  • Query Cache
  • Sort Buffer
  • Joins
  • Temp Tables
  • Table (Open & Definition) Cache
  • Table Locking
  • Table Scans (read_buffer)
  • Innodb Status
  • 木铎校园 BBS 社区P"cYF(K.u}D @ K

    jO*jrG Co7x0Recent Changes

  • Correct awk display error which formats integers > 4294967296 in scientific notation.
    q;N7Z.L.h6[u7Bv0- Was manfest in MEMORY USAGE section where total system RAM > 4GB.
  • Fixed rounding error where mysql will lose 4K from the join_buffer_size value.木铎校园 BBS 社区&rY2}3b)zf1t6t-n'O
    - Other values may have the same issue but are not yet reported
  • Added support for FreeBSD and MacOS (thanks Sam and Geert)
  • Added support for Solaris
  • Changed how system memory is derived on Linux.
    @O*vCm6B1_0- Use /proc/meminfo vs free -b and avoid inclusion of swap space.
  • Include note warning of instability when key_buffer_size > 4GB in versions 5.0.51 and lower
  • (e U7^p4a8}cJ0

    MySQL Replication Slave Delay tracker

    木铎校园 BBS 社区L9LF;g'FB

    This script takes information from "SHOW SLAVE STATUS" from MySQL +4.1 to show what
    !SQ#GP'{0the delay between the retrieved master's position and the slave's execution position.木铎校园 BBS 社区6Mb)p8]u

    6QfD7J Q ?*A2kg0木铎校园 BBS 社区$A3ea0I9K-`ZH:T

    This script has a 1 second granularity.
    !w$m cz|0

    /a z$P9Z3NI0

    Check MySQL Replication Slave Status

    #l4f(Gt n8x0This script produces no output when replication slave is running normally.
    %?4R-T@6]9N6^B0If either IO or SQL threads are not running it will print a message indicating so木铎校园 BBS 社区q aofT%x*@#Pl\
    and print the contentsof the "Last_error:"木铎校园 BBS 社区[w b ~9B2mKT

    木铎校园 BBS 社区R@z,dnJ

    I typically set it up on a 2minute cron. It has some logic in place to avoid repeat木铎校园 BBS 社区a#W`-wB2\%F
    e-mailing from CRON when down status is found. It will wait 15 minutes before producing木铎校园 BBS 社区K7V4iEs V
    the next message. You can also disable the scripts checking by changing the "active"木铎校园 BBS 社区xI!~B O#A;qbv
    variable to "no". This allows users without direct access to cron to controll the script.
    J%z]3H5C$nC0This script assumes that a ~/.my.cnf will be in place for authentication.木铎校园 BBS 社区.W,O3k)u gC;\` }

    u5_3Z"c Ry:yb.nL0

    MYSQL_BACKUP.sh

    This script pulls hot backups of MyISAM tables and flushes the binary log files when called with the 'DAILY' option
    a ck:K/h3RdC5X0When called with 'HOURLY' option it will rsync the binlogs for the server to the specified backup directory.
    g+v,o,f5a2f}O0Recently added support for InnoDB with the 3rd party 'ibbackup' utility Added support for MySQL 4.1 and 5.0.

    TAG: mysql MySQL performance Primer Tuning Performance Script

    引用 删除 Guest   /   2008-03-16 21:43:18
    5
     

    评分:0

    我来说两句

    显示全部

    :loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

    关于作者