zoukankan      html  css  js  c++  java
  • Tracing mysqld Using DTrace

     http://dev.mysql.com/doc/refman/5.6/en/dba-dtrace-server.html

    MySQL 5.6 Reference Manual -> 5 MySQL Server Administration :: 5.4 Tracing mysqld Using DTrace

    5.4.1 mysqld DTrace Probe Reference

    The DTrace probes in the MySQL server are designed to provide information about the execution of queries within MySQL and the different areas of the system being utilized during that process. The organization and triggering of the probes means that the execution of an entire query can be monitored with one level of probes (query-startand query-done) but by monitoring other probes you can get successively more detailed information about the execution of the query in terms of the locks used, sort methods and even row-by-row and storage-engine level execution information.

    The DTrace probes are organized so that you can follow the entire query process, from the point of connection from a client, through the query execution, row-level operations, and back out again. You can think of the probes as being fired within a specific sequence during a typical client connect/execute/disconnect sequence, as shown in the following figure.

    Figure 5.1 The MySQL Architecture Using Pluggable Storage Engines

    DTrace Probe Structure in mysqld

    Global information is provided in the arguments to the DTrace probes at various levels. Global information, that is, the connection ID and user/host and where relevant the query string, is provided at key levels (connection-startcommand-startquery-start, and query-exec-start). As you go deeper into the probes, it is assumed either you are only interested in the individual executions (row-level probes provide information on the database and table name only), or that you will combine the row-level probes with the notional parent probes to provide the information about a specific query. Examples of this will be given as the format and arguments of each probe are provided.

    MySQL 5.6 includes support for DTrace probes on these platforms:

    • Solaris 10 Update 5 (Solaris 5/08) on SPARC, x86 and x86_64 platforms

    • OS X 10.4 and higher

    • Oracle Linux 6 and higher with UEK kernel (as of MySQL 5.6.20)

    Enabling the probes should be automatic on these platforms. To explicitly enable or disable the probes during building, use the -DENABLE_DTRACE=1 or -DENABLE_DTRACE=0 option to CMake.

    If a non-Solaris platform includes DTrace support, building mysqld on that platform will include DTrace support.

    Additional Resources

  • 相关阅读:
    数据库路由中间件MyCat
    MyCat
    网页动画师与技术开发,如何精准高效的协作完成动效。
    JAVA异常的最佳工程学实践探索
    MySQL导入.sql文件及常用命令
    如何申请新浪SAE,发布自己的网站
    新手教程: 如何在新浪云计算SAE里部署代码
    微信公众平台开发(一) 配置接口
    SQL数据库面试题以及答案
    Sql Server之旅——终点站 nolock引发的三级事件的一些思考
  • 原文地址:https://www.cnblogs.com/zengkefu/p/4866515.html
Copyright © 2011-2022 走看看