hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : bash shell script for ioping disk I/O tests
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

bash shell script for ioping disk I/O tests

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-28-2011, 05:41 PM
eva2000 eva2000 is offline
Premium Member
 
Join Date: Apr 2000
Location: Brisbane, Australia
Posts: 1,069

bash shell script for ioping disk I/O tests


Hi guys

I'm writing a bash shell wrapper script for ioping but am stuck.

Here's the snippet of the non-working code

Code:
SOFTRAIDCHECK=`cat /proc/mdstat | grep active`

if [[ ! -z $SOFTRAIDCHECK ]]; then
DEVICES='{sd*,md*}'
else
DEVICES='sd*'
fi

echo "**********************************************"
echo "seek rate test (default 1MB working set size)"
echo "**********************************************"

for DEV in /sys/block/${DEVICES}
do

DEV=`echo ${DEV} | sed -e 's/\/sys\/block\///g'`
echo "seek rate: /dev/${DEV}"
ioping -R /dev/${DEV} | grep -E '(iops|mdev)'

echo ""
done
when run i get this error

Code:
**********************************************
seek rate test (default 1MB working set size)
**********************************************
seek rate: /dev/{sd*,md*}
ioping: stat "/dev/{sd*,md*}" failed: No such file or directory
but if I change

Code:
for DEV in /sys/block/${DEVICES}
to

Code:
for DEV in /sys/block/{sd*,md*}
it works and outputs

Code:
**********************************************
seek rate test (default 1MB working set size)
**********************************************
seek rate: /dev/sda
617 requests completed in 3006.7 ms, 310 iops, 1.2 mb/s
min/avg/max/mdev = 0.1/3.2/46.6/5.6 ms

seek rate: /dev/sdb
2121 requests completed in 3001.1 ms, 4564 iops, 17.8 mb/s
min/avg/max/mdev = 0.0/0.2/0.9/0.1 ms

seek rate: /dev/sdc
1762 requests completed in 3001.8 ms, 3324 iops, 13.0 mb/s
min/avg/max/mdev = 0.1/0.3/2.4/0.3 ms

seek rate: /dev/md0
1517 requests completed in 3001.0 ms, 2985 iops, 11.7 mb/s
min/avg/max/mdev = 0.1/0.3/1.0/0.2 ms
Any tips or suggestions are much appreciated

George

__________________
:: vB benchmarks = Litespeed Cache 721x times faster than Apache
:: MySQL benchmarks (MariaDB 5.2 Intel Opt >MariaDB 5.2 >Percona 5.5 >MySQL 5.5)
:: MySQL backup/restore = mydumper > mysqldump
:: CentminMod.com = Nginx Menu Installer (ngx_pagespeed supported)


Reply With Quote


Sponsored Links
  #2  
Old 08-28-2011, 05:58 PM
eva2000 eva2000 is offline
Premium Member
 
Join Date: Apr 2000
Location: Brisbane, Australia
Posts: 1,069
ok think i figured a workaround

change from

Code:
if [[ ! -z $SOFTRAIDCHECK ]]; then
DEVICES='{sd*,md*}'
else
DEVICES='sd*'
fi
to

Code:
if [[ ! -z $SOFTRAIDCHECK ]]; then
DEVICES=`ls /sys/block/ | grep -E '(^sd|^md)'`
else
DEVICES='sd*'
fi

__________________
:: vB benchmarks = Litespeed Cache 721x times faster than Apache
:: MySQL benchmarks (MariaDB 5.2 Intel Opt >MariaDB 5.2 >Percona 5.5 >MySQL 5.5)
:: MySQL backup/restore = mydumper > mysqldump
:: CentminMod.com = Nginx Menu Installer (ngx_pagespeed supported)


Reply With Quote
  #3  
Old 08-28-2011, 07:30 PM
eva2000 eva2000 is offline
Premium Member
 
Join Date: Apr 2000
Location: Brisbane, Australia
Posts: 1,069
working output

Code:
[root@localhost ~]# ./ioping.sh test

***************************************************
ioping code.google.com/p/ioping/
ioping.sh 0.6
shell wrapper script by George Liu (eva2000)
http://vbtechsupport.com
***************************************************

***************************************************
ioping disk I/O test (default 1MB working set size)
***************************************************
disk I/O: /dev/md0
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
5 requests completed in 4012.3 ms, 1296 iops, 5.1 mb/s
min/avg/max/mdev = 0.1/0.8/1.7/0.5 ms

disk I/O: /dev/sda
--- /dev/sda (device 20.0 Gb) ioping statistics ---
5 requests completed in 4030.9 ms, 246 iops, 1.0 mb/s
min/avg/max/mdev = 0.4/4.1/9.3/4.0 ms

disk I/O: /dev/sdb
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
5 requests completed in 4014.4 ms, 760 iops, 3.0 mb/s
min/avg/max/mdev = 0.1/1.3/3.3/1.2 ms

disk I/O: /dev/sdc
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
5 requests completed in 4010.9 ms, 1605 iops, 6.3 mb/s
min/avg/max/mdev = 0.1/0.6/1.6/0.6 ms

**********************************************
seek rate test (default 1MB working set size)
**********************************************
seek rate: /dev/md0
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
1855 requests completed in 3001.5 ms, 2560 iops, 10.0 mb/s
min/avg/max/mdev = 0.1/0.4/1.5/0.2 ms

seek rate: /dev/sda
--- /dev/sda (device 20.0 Gb) ioping statistics ---
631 requests completed in 3001.3 ms, 324 iops, 1.3 mb/s
min/avg/max/mdev = 0.1/3.1/53.0/5.4 ms

seek rate: /dev/sdb
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
1648 requests completed in 3002.5 ms, 2385 iops, 9.3 mb/s
min/avg/max/mdev = 0.1/0.4/1.3/0.2 ms

seek rate: /dev/sdc
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
1713 requests completed in 3001.6 ms, 3558 iops, 13.9 mb/s
min/avg/max/mdev = 0.1/0.3/1.0/0.2 ms

**********************************************
sequential test (default 1MB working set size)
**********************************************
-----------------------
sequential: /dev/md0
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
337 requests completed in 3007.0 ms, 136 iops, 34.0 mb/s
min/avg/max/mdev = 5.2/7.4/23.1/2.9 ms
-----------------------
sequential cached I/O: /dev/md0
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
1542 requests completed in 3000.4 ms, 5568 iops, 1392.0 mb/s
min/avg/max/mdev = 0.0/0.2/1.5/0.2 ms

-----------------------
sequential: /dev/sda
--- /dev/sda (device 20.0 Gb) ioping statistics ---
303 requests completed in 3000.1 ms, 119 iops, 29.7 mb/s
min/avg/max/mdev = 5.1/8.4/114.4/7.5 ms
-----------------------
sequential cached I/O: /dev/sda
--- /dev/sda (device 20.0 Gb) ioping statistics ---
832 requests completed in 3009.3 ms, 441 iops, 110.2 mb/s
min/avg/max/mdev = 0.0/2.3/26.2/4.1 ms

-----------------------
sequential: /dev/sdb
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
274 requests completed in 3011.2 ms, 107 iops, 26.9 mb/s
min/avg/max/mdev = 5.2/9.3/121.4/8.0 ms
-----------------------
sequential cached I/O: /dev/sdb
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
1588 requests completed in 3000.4 ms, 1609 iops, 402.3 mb/s
min/avg/max/mdev = 0.0/0.6/2.9/0.7 ms

-----------------------
sequential: /dev/sdc
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
372 requests completed in 3001.6 ms, 162 iops, 40.4 mb/s
min/avg/max/mdev = 5.2/6.2/12.7/1.4 ms
-----------------------
sequential cached I/O: /dev/sdc
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
1466 requests completed in 3000.6 ms, 1516 iops, 379.1 mb/s
min/avg/max/mdev = 0.0/0.7/3.0/0.7 ms

Run custom working set size 4 16 64 256 (KB) test ? [y/n]: y

################################
ioping disk I/O test
(custom 4 16 64 256 (KB) working set size)
################################

***************************************
[/dev/md0] ioping disk I/O test: 4K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
5 requests completed in 4008.9 ms, 6305 iops, 24.6 mb/s
min/avg/max/mdev = 0.0/0.2/0.5/0.2 ms

***************************************
[/dev/md0] ioping disk I/O test: 16K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
5 requests completed in 4009.4 ms, 11211 iops, 43.8 mb/s
min/avg/max/mdev = 0.0/0.1/0.2/0.1 ms

***************************************
[/dev/md0] ioping disk I/O test: 64K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
5 requests completed in 4043.0 ms, 142 iops, 0.6 mb/s
min/avg/max/mdev = 0.0/7.0/34.3/13.6 ms

***************************************
[/dev/md0] ioping disk I/O test: 256K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
5 requests completed in 4066.6 ms, 88 iops, 0.3 mb/s
min/avg/max/mdev = 0.0/11.4/40.8/15.4 ms


***************************************
[/dev/sda] ioping disk I/O test: 4K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
5 requests completed in 4049.2 ms, 119 iops, 0.5 mb/s
min/avg/max/mdev = 0.1/8.4/23.8/9.9 ms

***************************************
[/dev/sda] ioping disk I/O test: 16K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
5 requests completed in 4043.2 ms, 141 iops, 0.6 mb/s
min/avg/max/mdev = 0.4/7.1/20.0/8.3 ms

***************************************
[/dev/sda] ioping disk I/O test: 64K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
5 requests completed in 4014.0 ms, 755 iops, 2.9 mb/s
min/avg/max/mdev = 0.2/1.3/3.0/1.0 ms

***************************************
[/dev/sda] ioping disk I/O test: 256K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
5 requests completed in 4018.9 ms, 370 iops, 1.4 mb/s
min/avg/max/mdev = 0.5/2.7/10.5/3.9 ms


***************************************
[/dev/sdb] ioping disk I/O test: 4K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
5 requests completed in 4031.8 ms, 218 iops, 0.9 mb/s
min/avg/max/mdev = 0.1/4.6/21.1/8.3 ms

***************************************
[/dev/sdb] ioping disk I/O test: 16K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
5 requests completed in 4019.9 ms, 390 iops, 1.5 mb/s
min/avg/max/mdev = 0.2/2.6/8.2/3.0 ms

***************************************
[/dev/sdb] ioping disk I/O test: 64K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
5 requests completed in 4010.1 ms, 1459 iops, 5.7 mb/s
min/avg/max/mdev = 0.2/0.7/1.5/0.5 ms

***************************************
[/dev/sdb] ioping disk I/O test: 256K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
5 requests completed in 4021.0 ms, 358 iops, 1.4 mb/s
min/avg/max/mdev = 0.4/2.8/11.0/4.1 ms


***************************************
[/dev/sdc] ioping disk I/O test: 4K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
5 requests completed in 4009.7 ms, 1765 iops, 6.9 mb/s
min/avg/max/mdev = 0.1/0.6/1.4/0.4 ms

***************************************
[/dev/sdc] ioping disk I/O test: 16K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
5 requests completed in 4016.1 ms, 608 iops, 2.4 mb/s
min/avg/max/mdev = 0.1/1.6/3.5/1.3 ms

***************************************
[/dev/sdc] ioping disk I/O test: 64K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
5 requests completed in 4009.6 ms, 2615 iops, 10.2 mb/s
min/avg/max/mdev = 0.1/0.4/0.8/0.3 ms

***************************************
[/dev/sdc] ioping disk I/O test: 256K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
5 requests completed in 4013.4 ms, 785 iops, 3.1 mb/s
min/avg/max/mdev = 0.7/1.3/2.3/0.5 ms

################################
ioping seek rate test
(custom 4 16 64 256 (KB) working set size)
################################

***************************************
[/dev/md0] ioping seek rate test: 4K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
2019 requests completed in 3000.2 ms, 25232 iops, 98.6 mb/s
min/avg/max/mdev = 0.0/0.0/0.5/0.1 ms

***************************************
[/dev/md0] ioping seek rate test: 16K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
1765 requests completed in 3001.4 ms, 12510 iops, 48.9 mb/s
min/avg/max/mdev = 0.0/0.1/0.6/0.1 ms

***************************************
[/dev/md0] ioping seek rate test: 64K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
1583 requests completed in 3001.1 ms, 3462 iops, 13.5 mb/s
min/avg/max/mdev = 0.0/0.3/1.3/0.3 ms

***************************************
[/dev/md0] ioping seek rate test: 256K test
***************************************
--- /dev/md0 (device 57.4 Gb) ioping statistics ---
1461 requests completed in 3002.0 ms, 1370 iops, 5.4 mb/s
min/avg/max/mdev = 0.0/0.7/188.7/5.0 ms


***************************************
[/dev/sda] ioping seek rate test: 4K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
1514 requests completed in 3001.1 ms, 18925 iops, 73.9 mb/s
min/avg/max/mdev = 0.0/0.1/0.6/0.1 ms

***************************************
[/dev/sda] ioping seek rate test: 16K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
1535 requests completed in 3002.0 ms, 1919 iops, 7.5 mb/s
min/avg/max/mdev = 0.0/0.5/34.6/1.4 ms

***************************************
[/dev/sda] ioping seek rate test: 64K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
1630 requests completed in 3000.3 ms, 3209 iops, 12.5 mb/s
min/avg/max/mdev = 0.0/0.3/7.9/0.3 ms

***************************************
[/dev/sda] ioping seek rate test: 256K test
***************************************
--- /dev/sda (device 20.0 Gb) ioping statistics ---
1472 requests completed in 3000.5 ms, 1588 iops, 6.2 mb/s
min/avg/max/mdev = 0.0/0.6/34.6/1.4 ms


***************************************
[/dev/sdb] ioping seek rate test: 4K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
1651 requests completed in 3001.1 ms, 3517 iops, 13.7 mb/s
min/avg/max/mdev = 0.0/0.3/65.8/1.8 ms

***************************************
[/dev/sdb] ioping seek rate test: 16K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
1538 requests completed in 3001.2 ms, 1829 iops, 7.1 mb/s
min/avg/max/mdev = 0.0/0.5/1.4/0.4 ms

***************************************
[/dev/sdb] ioping seek rate test: 64K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
1760 requests completed in 3000.8 ms, 2453 iops, 9.6 mb/s
min/avg/max/mdev = 0.0/0.4/1.5/0.2 ms

***************************************
[/dev/sdb] ioping seek rate test: 256K test
***************************************
--- /dev/sdb (device 29.0 Gb) ioping statistics ---
1331 requests completed in 3002.0 ms, 1337 iops, 5.2 mb/s
min/avg/max/mdev = 0.0/0.7/49.0/1.7 ms


***************************************
[/dev/sdc] ioping seek rate test: 4K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
1558 requests completed in 3002.3 ms, 3841 iops, 15.0 mb/s
min/avg/max/mdev = 0.0/0.3/1.4/0.3 ms

***************************************
[/dev/sdc] ioping seek rate test: 16K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
1650 requests completed in 3002.1 ms, 2531 iops, 9.9 mb/s
min/avg/max/mdev = 0.0/0.4/1.5/0.3 ms

***************************************
[/dev/sdc] ioping seek rate test: 64K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
1655 requests completed in 3001.4 ms, 3074 iops, 12.0 mb/s
min/avg/max/mdev = 0.0/0.3/6.0/0.3 ms

***************************************
[/dev/sdc] ioping seek rate test: 256K test
***************************************
--- /dev/sdc (device 29.0 Gb) ioping statistics ---
1596 requests completed in 3003.1 ms, 1974 iops, 7.7 mb/s
min/avg/max/mdev = 0.0/0.5/2.0/0.2 ms

__________________
:: vB benchmarks = Litespeed Cache 721x times faster than Apache
:: MySQL benchmarks (MariaDB 5.2 Intel Opt >MariaDB 5.2 >Percona 5.5 >MySQL 5.5)
:: MySQL backup/restore = mydumper > mysqldump
:: CentminMod.com = Nginx Menu Installer (ngx_pagespeed supported)


Reply With Quote
Sponsored Links
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
ioping - measure vps disk latency FRCorey VPS Hosting 20 10-27-2011 03:27 PM
Looking for someone to program a simple Bash/Shell Script to run RSYNC Eleven2 Hosting Employment / Job Offers 3 02-01-2011 12:11 AM
Need some bash shell Script help warlockninja Programming Discussion 4 09-15-2007 03:08 PM
How To "split" using a Bash Shell Script? mrbt Hosting Security and Technology 3 12-18-2006 02:22 PM
Shell Bound: Restricted BASH Shell AtlantaWebhost.com Shared Hosting Offers 9 05-21-2001 11:05 AM

Related posts from TheWhir.com
Title Type Date Posted
WiredTree Decreases Customer Website Loading Times with SSD Caching Web Hosting News 2013-04-02 13:56:08
Pingdom Talks Top Web Hosting Cities and Countries Web Hosting News 2013-03-27 18:49:54
Google Cloud Service Adds Storage Options, Lowers Pricing, Expands European Support Web Hosting News 2012-11-26 16:00:50
Control Panel cPanel Launches New Apache Configuration Script Web Hosting News 2011-12-28 19:41:39
Web Host SpexHost Launches New Reseller Hosting Plans Web Hosting News 2011-08-19 15:35:58


Tags
bash shell, disk io, ioping

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?