- 浏览: 162491 次
- 性别:
- 来自: 北京
最新评论
-
BlueAeri:
好像旧了,有些参数没有,比如 --cups
VBoxManage命令详解 -
jiamb:
非常感谢!
学习ibatis的一些资料 -
memory_in_08:
正急着找ibatis的此资料呢,3k you..
学习ibatis的一些资料 -
小猪笨笨:
多谢···
学习ibatis的一些资料 -
mingxiao2010:
谢谢你的分享!!
学习ibatis的一些资料
For a couple of months there have been no updates to our msl patch, however recently I managed some time to change this. The functionality was extended a little bit and what’s even more important the patch is available for all the recent MySQL releases.
To remind anyone who has not yet come across this piece of code. msl (microslow) patch was developed a few years ago to allow more precise logging of query execution times into the slow log. Originally MySQL database offered a second time resolution and also a 2 second minimum for the query to get written, that is when you set long_query_time=1. After applying the patch you could see whether the time was 0.005s or 0.9s, which can make a substantial difference for the database and application performance. Over time msl patch grew with new features to let people learn more details of query execution, normally hidden from everyone’s eyes. Currently it’s used by many DBAs and developers to help in optimizations or troubleshooting the applications. We ourselves often rely on it when doing commercial MySQL consulting and MySQL AB has even adopted it into the official database distribution starting 5.1.21 release.
Below you will find the files to download, but first let me walk you through the installation and configuration because things changed along the way.
Installation
In order to use the patch first you will need to build the database binaries from source. This is unavoidable. Following this guide I hope should make it fairly easy even for those of you, who do not have much experience in that kind of tasks.
Of course the problem can be approached in many different ways, however I will be describing the method that is simple, non-intrusive to the system and additionally allows marginal database downtime. It should also work on virtually any Linux distribution and possibly under most other systems.
The patch is currently available for MySQL 5.0.45, 5.0.51a, 5.0.54a and 5.0.56. I assume you have some MySQL version installed already, but if it’s not any of these releases, you will need to upgrade (it will be worth it anyway ). You will also need to download the sources matching the installed database version. Once you have it all in place, we can begin.
Open command line (shell) on the server and go to the directory where the sources archive and the patch is. First you should determine how your current MySQL installation was built, so you can have the new binary to be as close to the original one as possible (e.g. to have the same set of storage engines or default paths):
(garfield:~/work) % env VISUAL=/bin/cat mysqlbug | grep 'Configure command'
Configure command: ./configure '--disable-shared' '--with-server-suffix=-community' '--without-embedded-server' '--with-ndbcluster' '--with-innodb' '--with-csv-storage-engine' (...)
From that output you can learn how to run configure command, which needs to be done prior to compiling the sources. It should be one long line full of various options and in the above case it was:
./configure '--disable-shared' '--with-server-suffix=-community' '--without-embedded-server' '--with-ndbcluster' '--with-innodb' '--with-csv-storage-engine' '--with-archive-storage-engine' '--with-blackhole-storage-engine' '--with-example-storage-engine' '--with-federated-storage-engine' '--without-bench' '--with-zlib-dir=bundled' '--with-big-tables' '--enable-assembler' '--enable-local-infile' '--with-mysqld-user=mysql' '--with-unix-socket-path=/var/lib/mysql/mysql.sock' '--with-pic' '--prefix=/' '--with-extra-charsets=all' '--with-yassl' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--libdir=/usr/lib64' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--infodir=/usr/share/info' '--includedir=/usr/include' '--mandir=/usr/share/man' '--enable-thread-safe-client' '--with-comment=MySQL Community Edition (GPL)' '--with-readline' 'CC=gcc' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXX=gcc' 'LDFLAGS='
Take your output and copy&paste it to some notepad for later. Next step is to extract the archive:
(garfield:~/work) % gzip -c -d mysql-5.0.51a.tar.gz | tar -x -v -f -
mysql-5.0.51a/
mysql-5.0.51a/bdb/
mysql-5.0.51a/bdb/Makefile.in
mysql-5.0.51a/bdb/btree/
mysql-5.0.51a/bdb/btree/bt_curadj.c
...
Once that has completed, enter the sources directory:
(garfield:~/work) % cd mysql-5.0.51a
Finally you can apply the patch:
(garfield:~/work/mysql-5.0.51a) % patch -p1 < ../patch-mysql-5.0.51a-msl.diff
patching file include/my_time.h
patching file scripts/mysqldumpslow.sh
patching file sql-common/my_time.c
patching file sql/filesort.cc
patching file sql/log.cc
patching file sql/log_event.cc
patching file sql/my_time.c
patching file sql/mysql_priv.h
patching file sql/mysqld.cc
patching file sql/set_var.cc
patching file sql/set_var.h
patching file sql/slave.cc
patching file sql/sql_cache.cc
patching file sql/sql_class.cc
patching file sql/sql_class.h
patching file sql/sql_parse.cc
patching file sql/sql_select.cc
patching file sql/sql_show.cc
patching file sql/structs.h
Now it is the time to run configure with all the options you discovered earlier. Please do not use the below example as it may not be suitable for your environment.
(garfield:~/work/mysql-5.0.51a) % ./configure '--disable-shared' '--with-server-suffix=-community' '--without-embedded-server' '--with-ndbcluster' '--with-innodb' '--with-csv-storage-engine' '--with-archive-storage-engine' '--with-blackhole-storage-engine' '--with-example-storage-engine' '--with-federated-storage-engine' '--without-bench' '--with-zlib-dir=bundled' '--with-big-tables' '--enable-assembler' '--enable-local-infile' '--with-mysqld-user=mysql' '--with-unix-socket-path=/var/lib/mysql/mysql.sock' '--with-pic' '--prefix=/' '--with-extra-charsets=all' '--with-yassl' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--libdir=/usr/lib64' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--infodir=/usr/share/info' '--includedir=/usr/include' '--mandir=/usr/share/man' '--enable-thread-safe-client' '--with-comment=MySQL Community Edition (GPL)' '--with-readline' 'CC=gcc' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'CXX=gcc' 'LDFLAGS='
This command will take about a minute to complete and it prints the following message at the end when everything goes fine:
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.
Thank you for choosing MySQL!
Otherwise you will see some error. The sources have been prepared for compilation, so you are ready to run it:
(garfield:~/work/mysql-5.0.51a) % make
Now it’s a good moment to go and get yourself a cup of tea, because for the next 5-10 minutes, depending on the hardware, you will be sitting idle and watching tons of text scrolling through the screen. The process should end with no errors and message like this one:
make[1]: Leaving directory `/home/macko/work/mysql-5.0.51a'
The new database binary should be now available in sql subdirectory:
(garfield:~/work/mysql-5.0.51a) % ls -l sql/mysqld
-rwxr-xr-x 1 macko macko 28467073 2008-04-18 20:31 sql/mysqld
If it’s not there, you had errors in compilation. You may strip the symbols off the binary to make it smaller:
(garfield:~/work/mysql-5.0.51a) % strip sql/mysqld
(garfield:~/work/mysql-5.0.51a) % ls -l sql/mysqld
-rwxr-xr-x 1 macko macko 7453516 2008-04-18 20:38 sql/mysqld
You are ready to have the patched MySQL installed in the system. Locate where the original mysqld binary is with:
(garfield:~/work/mysql-5.0.51a) % whereis mysqld
mysqld: /usr/sbin/mysqld /usr/share/man/man8/mysqld.8.bz2
As you can see in this case it resides in /usr/sbin, because the other file is just a manual. For the following operations you will need to become root user, unless you are already
(garfield:~/work/mysql-5.0.51a) % su root
Password:
First you should apply the changes to the database configuration, specifically you need to enable slow logging (see Configuration section for details). Then rename the binary, which can be safely done even with MySQL still running. This will also automatically create a backup of the un-patched version in case you need to restore it.
(garfield:~/work/mysql-5.0.51a) # cp /usr/sbin/mysqld /usr/sbin/mysqld.BAK-unpatched
Finally you can place the patched mysqld to the right location.
(garfield:~/work/mysql-5.0.51a) # cp sql/mysqld /usr/sbin/mysqld
Even though everything is ready, the database is still running the original code. In order to activate the patch you will need to restart MySQL. You can obviously choose the most convenient time, there is no rush. The restart can take as little as few seconds, however it will depend on many factors such as storage engines used (InnoDB will take significantly longer to close than MyISAM), database configuration, load, etc.
Configuration
There are several parameters related to slow log you can set with patch applied. All filter-type options work in conjunction meaning that in order for query to be logged it must match long_query_time AND min_examined_row_limit AND log_slow_filter.
log-slow-queries[=name]
Log slow queries to this log file. Defaults logging to hostname-slow.log file. Must be enabled to activate other slow log options.
This is the most important one as it enables the logging. If you don’t specify it in my.cnf file, the remaining part of the configuration will not matter, because the log file won’t be created. This is also the only option which you cannot change at runtime from MySQL console wit SET or SET GLOBAL command.
log_slow_filter=name
Log only the queries that followed certain execution plan. Multiple flags allowed in a comma-separated string. [qc_miss, full_scan, full_join, tmp_table, tmp_table_on_disk, filesort, filesort_on_disk]
It allows you to filter queries logged by execution plan. For example to log only queries doing full table scans you would need to set this to “full_scan”, while in order to get only those which use on-disk temporary storage for intermediate results “tmp_table_on_disk,filesort_on_disk” would be a proper flags set. To clear the filter just assign an empty string “” to this option.
Note: you should put double quotes around the entire string of comma-separated flags.
Can be changed at run time with both SET SESSION and SET GLOBAL.
log_slow_rate_limit=#
Rate limit statement writes to slow log to only those from every (1/log_slow_rate_limit) session.
With high traffic coming to your database, the slow logging may consume a lot of IO bandwidth and the file may grow huge very quickly when logging all the queries. This parameter allows you to get the full sessions logged while doing it only for every n-th of them thus limiting the number of writes to the log.
Note: this feature will fail to work well if your application uses some kind of connection pooling. Rate limiting is disabled for the replication thread.
Can be changed at run time with both SET SESSION and SET GLOBAL.
log_slow_verbosity=name
Choose how verbose the messages to your slow log will be. Multiple flags allowed in a comma-separated string. [microtime, query_plan, innodb]
msl patch currently can log three types of information: query timings, execution plan details and InnoDB engine per-query statistics. With this option you may choose which of those you want to have in your slow log. For example to have microsecond query timing and InnoDB statistics you would need to set this option to “microtime,innodb”.
Note: You should put double quotes around the entire string of comma-separated flags. Currently “microtime” is mandatory meaning you cannot disable it. “innodb” is only available with the patch supporting that feature.
Can be changed at run time with both SET SESSION and SET GLOBAL.
long_query_time=#
Log all queries that have taken more than long_query_time microseconds to execute to file.
This option is standard MySQL, however after you apply the patch, it will no longer take time in seconds. Instead it will want you to specify the number of microseconds.
Can be changed at run time with both SET SESSION and SET GLOBAL.
min_examined_row_limit=#
Don’t log queries which examine less than min_examined_row_limit rows to file.
If you are not interested in queries which scan no more than N rows, you can set this to the desired value.
Can be changed at run time with both SET SESSION and SET GLOBAL.
Downloads
msl patch for MySQL 5.0.45
msl patch for MySQL 5.0.51a
msl patch for MySQL 5.0.54a
msl patch for MySQL 5.0.56
msl patch for MySQL 5.0.45 with InnoDB extensions
msl patch for MySQL 5.0.51a with InnoDB extensions
msl patch for MySQL 5.0.54a with InnoDB extensions
msl patch for MySQL 5.0.56 with InnoDB extensions
发表评论
-
mysql索引优化方法 index
2011-04-19 11:06 1130http://www.111cn.net/database/1 ... -
用federated引擎在不同服务器间转移mysql表(转载)
2011-04-18 13:57 982用federated引擎在不同服务器间转移mysql表 ... -
(转载)MySQL 索引总结
2010-02-01 18:41 1178由于索引对数据库的查询性能有着至关重要的影响,下面是我的一些总 ... -
SHOW INNODB STATUS 分析
2009-09-11 17:59 1666SHOW INNODB STATUS 分析 2009-06- ... -
MySQL 锁的使用
2009-09-03 13:52 15327.3 锁7.3.1 锁机制 当前MySQL已经支持 ISA ... -
使用MYSQL索引
2009-09-02 10:27 1012关系数据库的世界是一 ... -
Monitoring MySQL
2009-08-20 11:20 1075Overall activity Questions ... -
Mysql Innodb 引擎优化(-) 参数篇
2009-05-06 18:01 1137参数篇 作/译者:吴炳 ... -
MySQL数据库中对前端和后台进行系统优化
2009-05-06 12:51 877本文中介绍的系统优化 ... -
MySQL配置文件my.cnf 例子最详细翻译,可以保存做笔记用。
2009-05-04 10:52 999MySQL配置文件my.cnf 例子最详细翻译,可以保存做笔记 ... -
MySQL优化实例
2009-04-29 11:23 1559原文地址: http://kb.discuz.net/ind ... -
MySQL 事件调度器(Event Scheduler)
2009-04-27 17:13 1508一、概述 事件调度器是在 MySQL 5.1 中新增的另一个 ... -
MYSQL中常用的工具
2009-04-27 10:42 17781.mysql(客户端链接工具): -u :指定用户名 ... -
mysql日志
2009-04-27 10:38 10541.错误日志是mysql中最只要的日志,记录了当mysqld启 ... -
mysql-master-slave
2009-02-12 17:36 14981.概述 MySQL Master-Slave是指MySQL ... -
mysql集群配置
2009-01-16 14:23 19681. 概述 MySQL Cluster是一种技术,该技术允 ... -
修改Linux的主机名
2008-12-29 15:17 912/etc/sysconfig/network文件中hostna ... -
卸载mysql
2008-12-26 09:40 12751.rpm 形式安装。 rpm -qa|grep -i mys ... -
linux设置环境变量
2008-12-25 14:44 914设置环境变量: 1.设置临时环境变量(重启后消失) expor ... -
mysql系列研究(2)---安装
2008-12-25 14:18 1103# cd /home/xiutuo/software/ # t ...
相关推荐
资源分类:Python库 所属语言:Python 资源全名:msl_loadlib-0.9.0-py2.py3-none-manylinux1_x86_64.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源分类:Python库 所属语言:Python 资源全名:msl_loadlib-0.6.0-py2.py3-none-manylinux1_i686.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
JESD规范-MSL测试规范主要涉及的是湿度/回流敏感度分类标准,用于非密封性表面贴装器件。MSL(Moisture Sensitivity Level)测试是电子产品可靠性测试的一个重要环节,它主要针对表面贴装技术(SMT)组件在生产过程...
前端项目-msl-client-browser,MSL浏览器客户端(模拟服务层)
《Metrowerks CodeWarrior MSL 5:构建高效嵌入式系统的关键工具》 在IT领域,尤其是在嵌入式系统开发中,Metrowerks CodeWarrior是一款备受推崇的集成开发环境(IDE)。这款工具以其强大的功能和对多种微控制器的...
IPC-J-STD-020详细规定了湿敏级别(Moisture Sensitivity Level, MSL)的分类,MSL分为1至5级,数字越大,表示器件对湿度越敏感。每个级别的定义基于器件在特定温度下暴露于湿度后的最大允许暴露时间,以防止吸湿...
MSL6000磁带库不仅可以在其内部进行扩充,它还可以借助一种通道(pass-through)机制,与MSL5000磁带库一同扩充,最多可支持16个磁带机和240个插槽。Ultrium 960、SDLT 600和Ultrium 460磁带机可用于升级当前安装的...
ckanext-custom_theme 要求 例如,您可能要在这里提及该扩展程序使用的CKAN版本。 安装 要安装ckanext-custom_theme: 激活您的CKAN虚拟环境,例如: ....将ckanext-custom_theme Python软件包安装到您的虚拟环境中:...
### HP MSL系列磁带机手册知识点概览 #### 一、HP MSL系列磁带机简介 HP MSL(Modular Smart Library)系列磁带机是惠普公司推出的一系列高可靠性的备份与归档解决方案,适用于中小型企业以及大型企业中的部门级...
本文将详细探讨MSL的概念及其重要性,并解释为何表面贴装技术(Surface Mount Technology, SMT)的组件相比传统的插件(Through-Hole Technology, THT)组件更容易受到湿度的影响。 #### MSL 的定义与重要性 MSL...
【标题】"z7mSL7d2-完美EFI.zip" 指的是一款与"黑苹果"(Black Apple)安装相关的EFI固件集合。在苹果操作系统中,“黑苹果”是指在非苹果硬件上安装Mac OS X或macOS的行为。EFI(Extensible Firmware Interface)是...
这是 MSL-Refbox 的 Android 版本。 RoboCup MSL Refbox 用于帮助裁判控制机器人足球比赛(由 RoboCup Midsize League 使用)。 它在 Android 4.0 平板电脑上运行,最小屏幕分辨率为 1280 x 800 mdpi (10.1" WXGA),...
HP MSL4080磁带机是一款高效能的存储解决方案,主要用于企业的长期数据备份和归档。在本文中,我们将深入探讨如何正确地安装和配置这款磁带机。 首先,我们来了解一下备份架构。在典型的配置中,生产服务器通过...
《Sprint MSL Finder v1.2:解锁与通信网络的深度探索》 在移动通信领域,Sprint MSL Finder v1.2是一款至关重要的工具,尤其对于那些需要理解和操作Sprint网络的用户来说。MSL(Master Subsidy Lock)是美国Sprint...
Get My MSL will display your Master Subsidy Lock code. This app is absolutely free, and ad-free. Please realize that this does not work on all devices (most HTC) before leaving negative feedback. ...
HP StorageWorks MSL2024磁带库采用小巧的2U外形,将高达9.6 TB的本机容量与磁带库特性结合在一起。其基于web的管理可集中管理很多站点,是复制系统的理想选择。MSL2024磁带库提供一个HP StorageWorksUltrium (傲群)...
《MSL570磁致伸缩静力水准传感器详解》 MSL570系列磁致伸缩静力水准传感器是一种专用于测量基础和建筑物各测点间相对高程变化的精密仪器,广泛应用于各类基础设施沉降监测,如水电站大坝、深基坑、高速公路、桥梁、...
HPE StoreEver系列磁带库包括MSL2024、MSL4048、MSL8048和MSL8096型号,它们提供了企业级的数据保护解决方案。磁带库是利用磁带技术存储大量数据的设备,通常用于备份、归档和长期存储。 #### 安装指南 - **安装前...
HP MSL4048磁带库可在紧凑的4U外形中提供高达38TB的压缩存储容量,同时还能够选配Ultrium 960、Ultrium 920或Ultrium 448 SCSI磁带驱动器。MSL4048标配条形码阅读器和四个可拆卸的12插槽磁带匣,使您可以轻松管理...