Skip to content

Instantly share code, notes, and snippets.

View stamhe's full-sized avatar

Stam He stamhe

View GitHub Profile
# 1. Make sure you have nginx sub module compiled in
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module'
# 2. add two directives below at HTTP level
# nginx.conf
http {
# ......
sub_filter '</head>' '<style type="text/css">html{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); } img { _filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0); -webkit-filter: grayscale(100%); } </style>';
#!/usr/bin/env python
#coding:utf-8
import sys, os, re
import logging
from tornado.ioloop import IOLoop
from tornado.iostream import IOStream
from tornado.netutil import TCPServer
#!/bin/bash
if [ $# -lt 2 ]; then
echo "usage:$0 dev output_dir [iodepth]"
exit 1
fi
DEV="$1"
OUTDIR="$2"
#!/bin/bash
if [ $# -lt 2 ]; then
echo "usage:$0 dev output_dir [iodepth]"
exit 1
fi
DEV="$1"
OUTDIR="$2"
测试磁盘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
#!/bin/bash
if [ $# -lt 2 ]; then
echo "usage:$0 dev output_dir [iodepth]"
exit 1
fi
DEV="$1"
OUTDIR="$2"
测试磁盘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
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
1. 建立DB节点
(其中2台为master,另一台为slave);
以master1作为主库
master1特殊配置:
# custom
server-id = 1001
log_bin = mysql-bin
log_bin_index = mysql-bin.index
log-slave-updates
测试磁盘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