This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo "usage:$0 dev output_dir [iodepth]" | |
echo "example 1: Testing the whole block device. Attention: That will destory the filesystem on the target block device" | |
echo "./run_fio.sh /dev/sdb fio_test" | |
echo "" | |
echo "example 2: Testing a file, but not destory filesystem. Suppose the target device mount on /data" | |
echo "fallocate -l 1G /data/test.dat" | |
echo "./run_fio.sh /data/test.dat fio_test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
测试磁盘IO性能的几种方法 | |
在磁盘测试中最关心的几个指标分别为:iops(每秒执行的IO次数)、bw(带宽,每秒的吞吐量)、lat(每次IO操作的延迟)。 | |
当每次IO操作的block较小时,如512bytes/4k/8k等,测试的主要是iops。 | |
当每次IO操作的block较大时,如256k/512k/1M等,测试的主要是bw。 | |
1. 最简单的dd | |
dd是linux自带的磁盘读写工具,可用于测试顺序读写。 | |
一般而言,磁盘读写有两种方式:BufferIO、DirectIO,DirectIO可以更好的了解纯磁盘读写的性能。 | |
1.1 dd测试DirectIO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. raid | |
1.1 查看物理卷信息 | |
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall | |
1.2 查看逻辑卷+物理卷 | |
/opt/MegaRAID/MegaCli/MegaCli64 -ldpdinfo -aall | |
1.2.1 查看逻辑卷 | |
/opt/MegaRAID/MegaCli/MegaCli64 -ldinfo -lall -aall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# First written by orczhou.com orchzou@gmail.com | |
# This program is free software; you can redistribute it and/or modify it under | |
# the terms of the GNU General Public License as published by the Free Software | |
# Foundation; version 2 of the License. | |
# How faster it is: | |
# $ls -lh backup.sql.gz | |
# -rw-r--r-- 1 mysql dba 14G Nov 21 04:49 backup.sql.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sector_list sample as below: | |
# 0 | |
# 512 | |
# 4087578 | |
# 4087579 | |
# 6324224 | |
# | |
# You should build a sector_list firstly, and then execute this script to catch the files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 1 ];then | |
echo "usage:$0 iplist" | |
exit 1 | |
fi | |
iplist=$1 | |
i=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
""" | |
Queries the slowlog database table and outputs it in | |
the normal MySQL slow log text format. | |
Run this script by: | |
python /path/to/slow_log_dump.py dbip dbport dbusr dbpwd [start_time] [end_time] > /path/to/slow_log_dump.log | |
Then you can run the normal mysqldumpslow parser on the output file (slow_log_dump.log) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# coding=utf8 | |
import sys, os | |
import random | |
import time | |
if __name__ == "__main__": | |
curtime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo "usage:$0 test_name {prepare|run|cleanup|gen}" | |
exit 1 | |
fi | |
test_name="$1" | |
cmd="$2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 1 ];then | |
echo "usage:$0 process_name" | |
exit 1 | |
fi | |
process_name="$1" | |
function straceall() |
NewerOlder