บ่อยครั้งที่ผู้ดแลระบบพบเจอปัญหาการทำงานหนักที่มาจาก MySQL แต่ไม่สามารถรู้ถึงสาเหตุที่แท้จริงได้ทั้งในเรื่องการ Performance Tuning หรือเป็นที่คำสั่ง Query ที่กินเครื่องเซิฟเวอร์ก็ตามวันนี้ผมมีเครื่องมือที่อยากจะมาแนะนำเพิ่มอีกตัวหนงคือ mytop ซึ่งจะเป็นตัวชั่วให้เรา Monitor หาสาเหตุได้ง่ายขึ้นและลดเวลาในการหาปัญหาได้
REQUIREMENTS
* Perl 5.005 or newer
* Getopt::Long
* DBI and DBD::mysql
* Term::ReadKey from CPAN
ติดตั้ง CPAN และ GIT
#yum -y install cpan git
#cpan
#install DBI Term::ReadKey Term::ANSIColor Time::HiRes DBD::mysql
ขั้นตอนการติดตั้ง MyTop
git clone https://github.com/jzawodn/mytop
#cd mytop
#perl Makefile.PL
#make test
#make
#make install
หลังจากติดตั้งแล้วให้ทดสอบพิมคำสั่ง mytop
สร้างไฟล์ ~/.mytop เพื่อที่จะได้ไม่ต้องกรอก Password ทุกครั้ง
user={ROOT}
pass={PASSWORD}
host=localhost
db=mysql
delay=1
port=3306
socket=
batchmode=0
header=1
color=1
idle=1
http://jeremy.zawodny.com/mysql/mytop/mytop.html