青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

牽著老婆滿街逛

嚴(yán)以律己,寬以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

Mtop,Mysql Top,一個(gè)Mysql的監(jiān)控工具

mtop 實(shí)時(shí)監(jiān)控 MySQL

Requires the following perl modules:
?
??? Module?????????????Available At
??? ------------?????--------------------------------------------------------
??? Curses????????????? http://cpan.linuxforum.net/authors/id/G/GI/GIRAFFED
??? DBI????????????????? Distributed as Bundle::DBI: http://www.cpan.org/authors/id/TIMB
??? DBD::mysql??????? http://www.cpan.org/modules/by-module/DBD
??? Getopt::Long???? (Distributed with Perl 5)
??? Net::Domain????? Part of libnet: http://www.cpan.org/authors/id/GBARR

# perl -e 'use Curses'
# perl -e 'use DBI'
# perl -e 'use DBD::mysql'
# perl -e 'use Getopt::Long'
# perl -e 'use Net::Domain'
?
沒有輸出就是模塊已經(jīng)安裝了,有錯(cuò)誤就是相應(yīng)的模塊沒有安裝。
可以在上面給出的地址下載相應(yīng)模塊的最新版本。

安裝所需的 Perl 模塊:
# tar zxvf Curses-x.xx.tar.gz
# cd Curses*
# perl Makefile.PL
# make
# make install
?
yum 倉庫里有 perl-DBI ,所以直接 yum 安裝,
# yum -y install perl-DBI
?
因?yàn)槭蔷幾g安裝的 MySQL ,所以需要把 lib 的路徑加入 ld.so.conf ,
# vi /etc/ld.so.conf
/usr/local/mysql/lib/mysql
# ldconfig
?
雖然 yum 倉庫里有 perl-DBD-MySQL ,但其依賴 mysql ,所以還是編譯安裝,
# tar zxvf DBD-mysql-x.xxxx.tar.gz
# cd DBD-mysql*
# perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config
# make
# make install
?
安裝 mtop :
# tar zxvf mtop-0.6.6.tar.gz
# cd mtop-0.6.6
# perl Makefile.PL
# make
# make install
?
添加相應(yīng)的 MySQL 數(shù)據(jù)庫用戶:
# mysql -uroot -pPASSWORD
mysql> GRANT RELOAD,PROCESS,SUPER ON *.* TO 'mtop'@'localhost' IDENTIFIED BY 'mtop';
mysql> FLUSH PRIVILEGES;
mysql> exit
?
運(yùn)行:
因?yàn)樽远x了 mysql.sock 的位置,所以需要做個(gè)鏈接 mtop 才能運(yùn)行,
# ln -s /var/run/mysqld/mysql.sock /tmp/mysql.sock
?
# mtop --dbuser=mtop --password=mtop
?
參考資料:http://mtop.sourceforge.net/






MTOP(1p)???????????????????????????? User Contributed Perl Documentation??????????????????????????? MTOP(1p)
NAME
?????? mtop - Shows top mysql threads
SYNOPSIS
?????????? mtop [--host={mysql_host}] [--dbuser={mysql_user}]
?????????????? [--password={mysqluser_pw}] [--seconds={refresh}] [--[no]idle]
?????????????? [--filter-user={regex}] [--filter-host={regex}] [--filter-db={regex}]
?????????????? [--filter-command={regex}] [--filter-state={regex}] [--filter-info={{regex}}]
?????????????? [--fold-select-columns]
?????????????? [--user={user}] [--manualrefresh] [--slow={seconds}] [--vs|veryslow={seconds}]
?????????????? [--vvs|veryveryslow={seconds}]
?????????? mtop --help
?????????? mtop --version
DESCRIPTION
?????? Shows the MySQL commands consuming the greatest time.? By default, only non-sleeping threads are
?????? shown, the --idle option shows idle threads.? While running several keys will affect the operation of
?????? mtop.? Hitting h or ? will show the available options.
?????? Normally, run as a console program this will allow you to see errant or badly optimized queries as
?????? they will stay on the screen for a while.? However, if you are hunting for short lived queries, run-
?????? ning in the manualrefresh mode with a short refresh time will allow you to catch short lived queries
?????? as well.
?????? The following keys are active while mtop is running:
?????????? q - quit
?????????? ? - help
?????????? Filtering/display
?????????? s - change the number of seconds to delay between updates
?????????? m - toggle manual refresh mode on/off
?????????? d - filter display with regular expression (user/host/db/command/state/info)
?????????? F - fold/unfold column names in select statement display
?????????? h - display process for only one host
?????????? u - display process for only one user
?????????? i - toggle all/non-Sleeping process display
?????????? o - reverse the sort order
?????????? Control/Detail
?????????? k - kill processes; send a kill to a list of ids
?????????? e - explain a process; show query optimizer info
?????????? z - zoom in on a process; show sql statement detail
?????????? f - flush stats (reset show status variables)
?????????? t - show mysqld stats (show status/mysqladmin ext)
?????????? T - show short/important status
?????????? v - show mysqld variables (show variables/mysqladmin vars)
?????????? r - show replication status for master/slaves

?????? Main Screen
?????? The main query screen shows the following information as well as the currently active queries (expla-
?????? nations are from the MySQL online manual and references refer to the section in the manual where the
?????? explanation came from):
?????? n Threads: running, cached
?????????? The n Threads represents how many threads the mysqld has allocated.? One thread is allocated for
?????????? each user connection.? Additional threads are allocated for replication.
?????? Queries/slow: Total queries / Total SLOW QUERIES
?????????? The first number is the total number of queries sent to the server since the last ’flush status’
?????????? or since server start.? The second number is the number of queries that have taken more than
?????????? long_query_time. See section 4.9.5 The Slow Query Log.
?????? Cache Hit: Cache hit ratio
?????????? This is the percentage of times a key read is handled from the key buffer cache.? See section
?????????? 4.5.7.4 SHOW VARIABLES of the MySQL manual for more information.
?????? Opened tables: tables opened
?????????? MySQL has a cache for open tables.? If ’opened tables’ is high, your cache may be too small.
?????????? Look at the MySQL manual section: 5.4.7 How MySQL Opens and Closes Tables for further informa-
?????????? tion.
?????? RRN: Handler_read_rnd_next
?????????? Number of requests to read the next row in the datafile. This will be high if you are doing a lot
?????????? of table scans. Generally this suggests that your tables are not properly indexed or that your
?????????? queries are not written to take advantage of the indexes you have. (4.5.7.3)
?????? TLW: Table_locks_waited
?????????? Number of times a table lock could not be acquired immediately and a wait was needed. If this is
?????????? high, and you have performance problems, you should first optimise your queries, and then either
?????????? split your table(s) or use replication. Available after 3.23.33.? (4.5.7.3)
?????? SFJ: Select_full_join
?????????? Number of joins without keys (If this is not 0, you should carefully check the indexes of your
?????????? tables). (4.5.7.3)
?????? SMP: Sort_merge_passes
?????????? Number of merges passes the sort algoritm have had to do. If this value is large you should con-
?????????? sider increasing sort_buffer. (4.5.7.3)
?????? QPS: Questions per second
?????????? The total number of sql commands handled by the MySQL server since startup or the last flush sta-
?????????? tus command.

?????? Statistics/Variables
?????? When viewing the stats screen (t), the screen will refresh until a key is pressed at which point you
?????? will return to the main screen.? The bottom of the stats screen is denoted with a line containing
?????? ---.? If you do not see that line, resize your screen until you do.
?????? The statistics screen has the following format:
?????????? Stat:????? total [avg per sec / instant per sec ]
?????? For example:
?????????? Questions:???? 720,672 [30/12]
?????? The short/important status screen is a list of recommendations from the MySQL manual.
?????? The first number is the total since startup or the last ’flush status’.? The second number is the
?????? number per second since startup or flush.? The last is the number per second since the last screen
?????? refresh.
?????? The variables screen only shows the information once and returns to the main screen as the variables
?????? do not change after server startup.

????? Replication
?????? The replication monitor screen looks for a master or slave server running on the currently monitored
?????? mysqld.? If a master server is found, it then tries to connect to each slave connected to the master.
?????? Replication is shown for all masters and slaves found.? Offsets from the master for each of the
?????? slaves is shown.? Note: the offset may be less than zero because the slave position is checked after
?????? the master position.? The offset shown is the number of queries in the binlog that the slave has to
?????? process before being caught up with the master.


OPTIONS
?????? All options can be abbreviated by their shortest unique abbreviation.
?????? -?, --help
?????????? Show the help screen and exit.
?????? -v, --version
?????????? Show the version number and exit.
?????? -h {mysql_host}, --host={mysql_host}
?????????? By default, the mysqld on localhost is monitored.? Specify an alternate host with this option.
?????? -dbu {mysql_user}, --dbuser={mysql_user}
?????????? By default, the user ’mysqltop’ is used to connect to the database.? Specify an alternate user
?????????? with this option.
?????? -p {mysqluser_pw}, --password={mysqluser_pw}
?????????? By default, there is no password associated with the mysqltop user, specify a password with this
?????????? option.
?????? -se {refresh}, --seconds={refresh}
?????????? The default screen refresh is 5 seconds.
?????? -sl {seconds}, --slow={seconds}
?????????? The number of seconds before a slow query is highlighted.? The default is the server’s long_query
?????????? configuration variable.
?????? -vs {seconds}, --veryslow={seconds}
?????????? The number of seconds before a very slow query is highlighted.? The default is the the --slow
?????????? option * 2.
?????? -vvs {seconds}, --veryveryslow={seconds}
?????????? The number of seconds before a very very slow query is highlighted.? The default is the the
?????????? --slow option * 4.
?????? -i, --[no]idle
?????????? By default, processes in the Sleep command state are not shown.? This option turns on display of
?????????? idle threads.
?????? -u {user}, --user={user}
?????????? Show only threads owned by this user.

?????? -fu {regex_pattern}, --filter-user={regex_pattern}
?????? -fh {regex_pattern}, --filter-host={regex_pattern}
?????? -fd {regex_pattern}, --filter-db={regex_pattern}
?????? -fs {regex_pattern}, --filter-state={regex_pattern}
?????? -fc {regex_pattern}, --filter-command={regex_pattern}
?????? -fi {regex_pattern}, --filter-info={regex_pattern}
?????????? Filter the display based on the regex_pattern provided.? The regex_pattern is a perl regular
?????????? expression.? The regular expression match is done with case insensitivity.
?????????? For example, to only show select statements on the user table, use the following:
?????????????? --filter-info=’select from user’
?????????? or, to be more forgiving for mutil-table joins and extra spaces, use:
?????????????? --filter-info=’select\s+from\s+.*\buser\b.*where’
?????????? These same regular expression filters can be used with the interactive d command.? Be careful to
?????????? escape any special shell characters in the regex.
?????? -m, --manualrefresh
?????????? In this mode, the screen only refreshes when the user hits a key on the keyboard.? The screen
?????????? will refresh automatically until a query is seen and then wait for further input.? An uppercase M
?????????? will appear in the top right hand corner of the screen to indicate that you are in this mode.
?????? All options can be stored in initialization files.? Command line options override options stored in
?????? the initialization file(s).? The following files are checked for arguments: current direcotry .mto-
?????? prc, home directory .mtoprc, /usr/local/etc/mtoprc, /etc/mtoprc.? Options in the former files over-
?????? ride options in the later files.
?????? The format of the initialization file is one option per line.? Options are specified just as they
?????? would be on the command line.? They can be abbreviated and use the one or two hyphen syntax.? Com-
?????? ments and blank lines are ignored.? The following is an exmple .mtoprc file which sets a user filter
?????? to user1 and sets the refresh rate to one second:
?????????? #? Only look at ’user1’
?????????? -fu user1
?????????? --seconds=1?? # refresh every one seconds

SETUP
?????? The most convenient way to setup your system to use mtop is to create a database user called mysqltop
?????? which has no password.? For security purposes, this user should have all privileges set to N except
?????? Process_priv which must be set to Y.
?????? To grant these privileges, execute the following from the MySQL command prompt
?????? For mysql 4.0.2 and greater:
?????????? mysql> grant super, reload, process on *.* to mysqltop;
?????????? mysql> grant super, reload, process on *.* to mysqltop@localhost;
?????????? mysql> flush privileges;
?????? For mysql 3.x and 4.0.1:
?????????? mysql> grant reload, process on *.* to mysqltop;
?????????? mysql> grant reload, process on *.* to mysqltop@localhost;
?????????? mysql> flush privileges;
?????? Notes:
?????? ·?? GRANT only works in MySQL 3.22.11 or later, for earlier versions add the user manually and fix
?????????? the permissions as noted above.
?????? ·?? The GRANT to mysqltop and mysqltop@localhost may be modified depending upon which hosts you want
?????????? to grant access from.? In general, you probably want to limit it to the hosts in your domain.
?????? ·?? The reload privilege is not required for mtop to do basic monitoring.? It is only needed if you
?????????? wish to issue flush commands from mtop.? The super privilege is needed if you wish to kill
?????????? queries in mysql 4.0.2 versions and above.? In 3.x, the process privilege allows a user to termi-
?????????? nate a query.
?????? Initially, mtop does not connect to a specific database.? Most commands this program issues are non-
?????? database specific (SHOW FULL PROCESSLIST, SHOW VARIABLES, KILL id).? However, when database-specific
?????? commands are needed, mtop will try to connect to the the required database and prompt for a user-
?????? name/password if the default one fails.


?????? To install mtop, run the following shell commands:
?????????? perl Makefile.PL
?????????? make
?????????? make install
?????? The default {install_prefix} is /usr/local which means that mtop is installed in /usr/local/bin/.? To
?????? change this, run:
?????????? perl Makefile.PL --prefix={install_prefix}
?????? or modify the PREFIX line in Makefile.PL.
?????? Requires the following perl modules:
?????????? Module??????? Available At
?????????? ------------? --------------------------------------------------------
?????????? Curses??????? http://www.cpan.org/authors/id/WPS
?????????? DBI?????????? Distributed as Bundle::DBI: http://www.cpan.org/authors/id/TIMB
?????????? DBD::mysql??? http://www.cpan.org/authors/id/JWIED
?????????? Getopt::Long? (Distributed with Perl 5)
?????????? Net::Domain?? Part of libnet: http://www.cpan.org/authors/id/GBARR/
AUTHOR
?????? Marc Prewitt, Chelsea Networks <mprewitt@chelsea.net>
?????? Copyright (C) 2002 Marc Prewitt/Chelsea Networks, under the GNU GPL.? mtop comes with ABSOLUTELY NO
?????? WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see
?????? the COPYING file for details.
KNOWN BUGS
?????? The cache hit ratio may look very low if your server receives more than 4 billion key_read_requests.
?????? This is due to a roll-over condition.? If that number exceeds 4 billion and change, it rolls over to
?????? 1.? The cache hit ratio is calculated as: 100 - (key_reads/key_read_requests) * 100.
?????? If you are really trying to focus on the cache hit ratio, flush the status variables with the mtop f
?????? command to reset both the key_reads and key_read_requests.
?????? Win2K telnet.exe - If you are using the Windows 2000 telnet program, it defaults to ansi mode which
?????? doesn’t work well with curses (in my testing on Solaris 8).? To work around this, set the terminal
?????? type to vt100.? To do this, issue the following command from the telnet prompt before connecting to a
?????? host:
?????????? set term vt100
?????? Alternatively, you can manually set your TERM environment variable to vt100 after you are logged in.
TODO
?????? Offer sorts by other columns
?????? For the ’More:’ paging, it would be nice to support ’Less’ behaviour.
?????? Add ’n’ command and properly calculate number of lines on screen.
?????????? $Id: mtop.PL,v 1.61 2004/09/12 22:22:03 mdprewitt Exp $

posted on 2007-01-25 20:31 楊粼波 閱讀(2445) 評(píng)論(0)  編輯 收藏 引用


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久精品91| 最新中文字幕亚洲| 久久精品日韩| 欧美一级一区| 久久精品系列| 久久九九热免费视频| 欧美专区亚洲专区| 久久久99免费视频| 欧美成人xxx| 欧美日韩少妇| 国产一区二区三区在线观看精品 | 亚洲欧美日韩国产成人精品影院| 亚洲午夜国产成人av电影男同| 99亚洲一区二区| 亚洲尤物视频在线| 久久久久久国产精品一区| 欧美成人精品1314www| 欧美日韩在线观看一区二区三区| 国产精品一区二区三区久久久 | 久久爱另类一区二区小说| 久久久久国产一区二区三区四区| 嫩草伊人久久精品少妇av杨幂| 欧美激情中文字幕一区二区| 欧美亚洲第一页| 亚洲国产日韩精品| 亚洲午夜久久久久久久久电影院| 久久精品国产久精国产一老狼| 欧美激情五月| 午夜在线不卡| 欧美精品日韩综合在线| 国产一区视频网站| 亚洲午夜av在线| 久久精品一区二区三区中文字幕| 久久深夜福利免费观看| 中文成人激情娱乐网| 久久久久国产精品人| 国产精品免费观看在线| 亚洲欧洲综合另类| 久久久久久一区二区| 亚洲私人影吧| 欧美日韩午夜激情| 亚洲精品国产无天堂网2021| 久久嫩草精品久久久精品| 洋洋av久久久久久久一区| 欧美成人精品在线观看| 伊大人香蕉综合8在线视| 午夜精品一区二区三区在线播放 | 亚洲一区二区三区精品动漫| 欧美成人一二三| 欧美在线免费观看| 国产精品你懂得| 亚洲一区二区网站| 亚洲片区在线| 亚洲一区二区影院| 国产精品成人一区二区艾草| 亚洲精品乱码久久久久久黑人 | 亚洲一区中文| 欧美日韩精品一区二区在线播放| 在线国产欧美| 免费欧美日韩| 欧美成人a视频| 一本大道av伊人久久综合| 亚洲成色www8888| 麻豆精品视频| 亚洲精品中文在线| 亚洲肉体裸体xxxx137| 欧美激情精品久久久久久黑人 | 亚洲精品在线观看视频| 欧美一区二区三区在线| 亚洲欧美日韩中文在线制服| 免费成人av| 亚洲精品久久嫩草网站秘色| 欧美岛国激情| 欧美激情片在线观看| 亚洲人成网在线播放| 亚洲激情亚洲| 欧美日韩一区在线播放| 一区二区激情| 亚洲一区二区视频在线| 国产一区二区在线观看免费| 久久久久久亚洲精品杨幂换脸 | 亚洲欧洲综合另类| 欧美激情一区二区| 亚洲午夜黄色| 欧美一区二区三区久久精品茉莉花 | 黄色av成人| 91久久精品美女高潮| 欧美午夜视频| 久久综合色8888| 欧美精品 国产精品| 亚洲一区在线播放| 亚洲欧美日韩一区二区三区在线| 国产综合色一区二区三区| 欧美福利一区二区| 国产精品v亚洲精品v日韩精品 | 欧美视频一区二区三区…| 亚洲免费一级电影| 久久亚洲影音av资源网| 亚洲图片欧洲图片av| 欧美中文字幕在线视频| 日韩一级大片| 欧美一区二区三区精品| 99精品欧美一区二区蜜桃免费| 亚洲一区二区三区涩| 精品9999| 亚洲伊人网站| 日韩午夜av| 久久国产精品色婷婷| 这里只有精品丝袜| 久久综合久久久久88| 欧美一区二区三区在线看 | 欧美日韩亚洲综合| 久久综合色88| 国产亚洲精品久久飘花| 夜夜夜久久久| 亚洲精品视频在线观看免费| 久久国产66| 久久国产视频网站| 欧美午夜在线一二页| 亚洲福利视频在线| 黄色精品网站| 欧美一区二区三区四区视频| 性欧美暴力猛交69hd| 欧美激情视频一区二区三区不卡| 久久se精品一区二区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ入口 | 老巨人导航500精品| 国产精品中文字幕欧美| 亚洲毛片一区| a4yy欧美一区二区三区| 美女精品在线观看| 欧美.www| 在线观看亚洲精品| 久久国产黑丝| 久久躁狠狠躁夜夜爽| 国产在线视频欧美一区二区三区| 一区二区三区精品视频在线观看| 一本大道av伊人久久综合| 欧美区高清在线| 最新中文字幕一区二区三区| 亚洲激情影视| 欧美精品三区| 亚洲免费电影在线观看| av成人黄色| 国产精品久久久久久妇女6080| 亚洲桃色在线一区| 欧美一区二区三区四区在线 | 国产一区二区在线观看免费播放 | 麻豆久久婷婷| 欧美激情1区2区3区| 亚洲乱码国产乱码精品精| 欧美 日韩 国产在线| 亚洲欧洲一区二区天堂久久 | 亚洲一区二区久久| 国产精品国产三级国产aⅴ入口 | 欧美肥婆bbw| 91久久精品国产91久久性色tv| 日韩西西人体444www| 欧美色123| 欧美中文字幕久久| 欧美激情欧美激情在线五月| 亚洲神马久久| 国产日韩精品一区二区| 久久久精品一品道一区| 亚洲福利视频免费观看| 亚洲自拍高清| 永久555www成人免费| 欧美久久视频| 午夜精品免费在线| 亚洲国产另类久久精品| 性久久久久久久久| 亚洲激情偷拍| 国产伦精品一区二区三区照片91 | 一区二区三区成人| 国产精品久久久久久久久搜平片 | 国产婷婷色一区二区三区在线 | 99精品欧美一区二区三区| 翔田千里一区二区| 亚洲国产乱码最新视频| 欧美日韩国产色综合一二三四 | 欧美成人精品1314www| 午夜精品视频在线观看一区二区| 久久影视三级福利片| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 国产精品人人做人人爽人人添| 羞羞答答国产精品www一本 | 91久久久久久| 国产精品乱码妇女bbbb| 久久综合久久综合久久| 亚洲午夜日本在线观看| 欧美黄色一区| 蜜臀va亚洲va欧美va天堂| 午夜精品免费| 亚洲视频久久| 亚洲日本中文| 国产一区二区毛片| 国产精品久久久久秋霞鲁丝| 欧美片网站免费| 欧美第十八页| 久久亚洲私人国产精品va|