`
gaojingsong
  • 浏览: 1182723 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

【Mysql监控工具之mytop】

阅读更多

要对mysql的运行性能进行监控的话工具也非常多。强大复杂的有 oracle官方提供的mysql 企业监控器(当然是收费的),当然开源的配置nagios、cacti上运行的mysql-monitor插件也不少。而想要实时的观察的话,也有mytop、mycheckpoint(绘图显示)、mtop(托管在sourceforge,从04年至今没见更新了。还有一个mongodb 的监控工具也要mtop,托管在github)等等。

 

该工具说白了就是一段perl脚本,依赖于别外一个perl包。主页上作者说的也比较明白了:

 

It runs on most Unix systems (including Mac OS X) which have Perl, DBI, and Term::ReadKey installed. And with Term::ANSIColor installed you even get color. If you install Time::HiRes, you'll get good real-time queries/second stats. As of version 0.7, it even runs on Windows (somewhat)



 

 mytop的设计灵感来自于系统监视工具top,两者的很多功能命令非常相似,Linux、FreeBSD和Solaris用户应该对此命令较为熟悉。mytop将连接到一个MySQL服务器,定时运行SHOW PROCESSLIST和SHOW STATUS命令,并试图以一个有用的格式汇总这些信息。

 

INSTALLATION

 tar -zxvf mytop-<version>.tar.gz

  cd mytop-<version>

  perl Makefile.PL

  make

  make test

  make install

 

  The test is a bit stupid, but it's there from completeness.

 

DOCUMENTATION

 

  man mytop

 

 

Arguments

mytop handles long and short command-line arguments. Not all options have both long and short formats, however. The long arguments can start with one or two dashes `-' or `--'. They are shown here with just one.

-u or -user username

Username to use when logging in to the MySQL server. Default: ``root''.

-p or -pass or -password password

Password to use when logging in to the MySQL server. Default: none.

-h or -host hostname[:port]

Hostname of the MySQL server. The hostname may be followed by an option port number. Note that the port is specified separate from the host when using a config file. Default: ``localhost''.

-port or -P port

If you're running MySQL on a non-standard port, use this to specify the port number. Default: 3306.

-s or -delay seconds

How long between display refreshes. Default: 5

-d or -db or -database database

Use if you'd like mytop to connect to a specific database by default. Default: ``test''.

-b or -batch or -batchmode

In batch mode, mytop runs only once, does not clear the screen, and places no limit on the number of lines it will print. This is suitable for running periodically (perhaps from cron) to capture the information into a file for later viewing. You might use batch mode in a CGI script to occasionally display your MySQL server status on the web.

Default: unset.

-S or -socket /path/to/socket

If you're running mytop on the same host as MySQL, you may wish to have it use the MySQL socket directly rather than a standard TCP/IP connection. If you do,just specify one.

Note that specifying a socket will make mytop ignore any host and/or port that you might have specified. If the socket does not exist (or the file specified is not a socket), this option will be ignored and mytop will use the hostname and port number instead.

Default: none.

-header or -noheader

Sepcify if you want the header to display or not. You can toggle this with the h key while mytop is running.

Default: header.

-color or -nocolor

Specify if you want a color display. This has no effect if you don't have color support available.

Default: If you have color support, mytop will try color unless you tell it not to.

-i or -idle or -noidle

Specify if you want idle (sleeping) threads to appear in the list. If sleeping threads are omitted, the default sorting order is reversed so that the longest running queries appear at the top of the list.

Default: idle.

Command-line arguments will always take precedence over config file options. That happens because the config file is read BEFORE the command-line arguments are applied

.

  • 大小: 157.7 KB
0
1
分享到:
评论

相关推荐

    mysql的工具mytop补丁

    MySQL是一种广泛使用的开源关系型数据库管理系统,而mytop则是用于监控MySQL服务器性能的一款命令行工具,类似于Linux系统中的top命令。mytop通过实时显示数据库的活动状态,帮助管理员监控查询性能、跟踪慢查询、...

    mytop 使用介绍 mysql实时监控工具

    `mytop` 是一款强大的 MySQL 实时监控工具,它的设计灵感来源于 Linux 系统中的 `top` 命令,可以提供对 MySQL 服务器性能的实时、动态监控。这款工具可以帮助管理员快速了解数据库的运行状况,包括查询效率、连接...

    MySQL监控工具小集合[归纳].pdf

    MySQL监控工具是数据库管理员在日常运维中不可或缺的辅助手段,它们可以帮助我们实时了解数据库的运行状态,及时发现并解决问题。以下是一些常见的MySQL监控工具的详细介绍: 1. **Cacti**:Cacti是一款基于PHP、...

    linux 下cpu mem 监控的mytop源码

    `mytop`是一款基于命令行的实时监控工具,它模仿了MySQL数据库管理中的`top`命令,提供了针对MySQL服务器性能的实时查看和分析功能。你提到的"linux下cpu mem监控的mytop源码"正是这样的一个工具,通过分析源码,...

    mysql运行监控全解析

    - **Mytop**:类似top命令的实时MySQL监控工具。 7. **监控代理和服务** - **Nagios**:通用的IT基础设施监控系统,可监控MySQL状态。 - **Zabbix**:企业级监控解决方案,支持MySQL监控。 - **Prometheus**:...

    mytop安装所有软件包

    在Linux环境中,mytop是一款非常实用的MySQL性能监控工具,它的功能类似于系统级的top命令,但专门针对MySQL数据库进行实时监控。mytop允许管理员快速查看数据库的状态,包括查询速度、连接数、等待时间等关键指标,...

    MYSQL性能调优工具介绍与应用

    3. **orzdba**:一款全面的MySQL监控工具,集成了多种功能,如查询分析、索引优化建议等,适合于高级DBA使用。 4. **tcpdump + pt-query-digest**:组合使用可以抓取网络数据包中的SQL语句,对于诊断网络延迟导致...

    mytop-1.6.tar.gz

    《mytop-1.6:一个强大的MySQL性能监控工具》 在MySQL数据库管理中,实时监控数据库性能至关重要,而mytop就是这样一款强大的命令行工具。mytop是Jeremy Zawodny为MySQL设计的一个类似top的实时监控工具,它提供了...

    款最好用的mysql——ui管理工具.pdf

    6. **mytop**:mytop是一款基于控制台的MySQL性能监控工具,适用于Unix系统,包括Mac OS X。它以类似于"top"命令的方式显示MySQL服务器的线程和性能指标,支持彩色输出和实时统计。mytop通过定期运行SHOW ...

    MySQL实时监控工具orztop的使用介绍

    - **mytop**:mytop是另一个常用的MySQL监控工具,它提供类似top命令的界面,显示数据库的连接数、查询速率等信息。 - **mtop**:MySQLMTOP提供更丰富的监控指标,包括慢查询、InnoDB锁等。 - **Zabbix、Prometheus ...

    mysql工具包.rar

    8. mytop:类似于Unix的top命令,mytop提供了一个实时的视图,显示MySQL服务器的活动,帮助监控和分析性能。 9. MySQL Server:这通常是MySQL的核心服务,负责处理来自客户端的数据库请求,管理数据存储和检索。 ...

    mysql优化笔记+资料

    3. 使用MySQL Tuner或mytop等工具自动或手动调整MySQL服务器参数。 这些笔记涵盖了MySQL优化的主要方面,包括查询优化、SQL编写技巧、数据库设计、存储引擎选择、服务器配置、硬件升级、定期维护以及使用各种工具...

    mysql innodb的监控(系统层,数据库层)

    也可以用一些现成的监控工具进行查询,目前用的比较多的innotop、mysqlreport、mtop、mytop,还有淘宝perl语言研发的orzdba。 就监控的指标而言,有系统层面的,数据库层面的。 1、系统层面包括系统的load、cpu、...

    mysql 性能优化与架构设计(word版)

    3. 调优工具:MySQLTuner、mytop、Innodb Monitor等可以帮助自动调整MySQL配置参数,优化系统性能。 总结,MySQL性能优化与架构设计涵盖了许多方面,包括查询优化、索引策略、数据库设计、缓存利用、并行处理、架构...

    MariaDB性能调优工具mytop的使用详解

    MariaDB的性能调优是数据库管理员的关键任务之一,而mytop作为一款强大的性能监控工具,提供了实时的数据库活动视图,有助于快速识别性能瓶颈。在本文中,我们将深入探讨mytop的使用方法及其显示结果的解析。 mytop...

    业界最具影响力MySQL精品文章荟萃(300篇)

    #### 六、MySQL监控与性能分析工具 - **mytop**:类似于`top`命令,用于实时监控MySQL服务状态。 - **其他工具**:如`Percona Toolkit`等第三方工具,提供更全面的性能监控功能。 #### 七、MySQL存储引擎与表设计 ...

    mysql数据库

    MySQL提供了一系列的管理和监控工具,如MySQL Workbench用于图形化管理数据库,pt-query-digest用于分析慢查询日志,以及mytop、mysqladmin等命令行工具。 总之,MySQL数据库是一个强大且灵活的解决方案,适用于...

    MySQL DBA血与泪最佳实践32条

    12. **性能调优工具**:使用`pt-query-digest`、`mytop`等工具进行性能分析和监控。 13. **硬件优化**:根据工作负载选择合适的硬件,如SSD硬盘、足够的内存和适当的CPU核心数。 14. **查询缓存**:虽然MySQL 8.0...

Global site tag (gtag.js) - Google Analytics