This file contains 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/sh | |
# | |
modprobe ipt_MASQUERADE | |
modprobe ip_conntrack_ftp | |
modprobe ip_nat_ftp | |
iptables -F | |
iptables -t nat -F | |
iptables -X | |
iptables -t nat -X | |
###########################INPUT键################################### |
This file contains 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/sh | |
DATETIME=`date +%y%m%d.%H%M` | |
LOG_DIR="/var/log/monitor/" | |
INTERVAL=5 | |
COUNT=`expr 3600 \/ $INTERVAL` | |
LOG_FILE=${LOG_DIR}os.${DATETIME}.${INTERVAL}.txt | |
CSV_LOG_FILE=${LOG_DIR}os.${DATETIME}.${INTERVAL}.csv | |
MYSQL_LOG_FILE=${LOG_DIR}os.${DATETIME}.${INTERVAL}.csv |
This file contains 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
for size in 256M 16G; do | |
for mode in seqwr seqrd rndrd rndwr rndrw; do | |
sysbench --test=fileio --file-num=1 --file-total-size=$size prepare | |
for threads in 1 4 8 16; do | |
echo PARAMS $size $mode $threads> sysbench-size-$size-mode-$mode-threads-$threads | |
sysbench --test=fileio --file-total-size=$size --file-test-mode=$mode\ | |
--max-time=60 --max-requests=10000000 --num-threads=$threads --init-rng=on\ | |
--file-num=1 --file-extra-flags=direct --file-fsync-freq=0 run \ | |
>> sysbench-size-$size-mode-$mode-threads-$threads 2>&1 | |
done |
This file contains 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
mysqladmin ext -i1 | awk ' | |
/Queries/{q=$4-qp;qp=$4} | |
/Threads_connected/{tc=$4} | |
/Threads_running/{printf "%5d %5d %5d\n", q, tc, $4}' |
This file contains 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
user="" | |
passwd="" | |
dbname="" | |
for table in `mysql -u$user -p$passwd $dbname -BNe 'show tables'; do | |
mysqldump -u$user -p$passwd --single-transaction $dbname $table |gzip > $table.sql.gz | |
done |
This file contains 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
mysqlbinlog mysql-bin.000045 | \ | |
grep -i -e "^update" -e "^insert" -e "^delete" -e "^replace" -e "^alter" | \ | |
cut -c1-100 | tr '[A-Z]' '[a-z]' | \ | |
sed -e "s/\t/ /g;s/\`//g;s/(.*$//;s/ set .*$//;s/ as .*$//" | sed -e "s/ where .*$//" | \ | |
sort | uniq -c | sort -nr |
NewerOlder