dbTalk Databases Forums  

get top 5 i/o busy session

comp.databases.informix comp.databases.informix


Discuss get top 5 i/o busy session in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
joe
 
Posts: n/a

Default get top 5 i/o busy session - 01-29-2011 , 02:51 AM






How to get top 10 i/o busy session by running
'onstat -u' and order by " nreads+nwrites" column that addition
values of "nreads and nwrites"

onstat -u | sort -rnk9 | head -n5
will get top 5 nreads sessions

onstat -u | sort -rnk10| head -n5
will get top 5 nwrites sessions

Reply With Quote
  #2  
Old   
KN Liew Liew
 
Posts: n/a

Default Re: get top 5 i/o busy session - 01-29-2011 , 03:23 AM






Is this what you want:
onstat -u|awk '{print $0, ($9+$10)}'|sort -rnk11|head -n 10


On Sat, Jan 29, 2011 at 4:51 PM, joe <joeclhua (AT) gmail (DOT) com> wrote:

Quote:
How to get top 10 i/o busy session by running
'onstat -u' and order by " nreads+nwrites" column that addition
values of "nreads and nwrites"

onstat -u | sort -rnk9 | head -n5
will get top 5 nreads sessions

onstat -u | sort -rnk10| head -n5
will get top 5 nwrites sessions

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #3  
Old   
Malc
 
Posts: n/a

Default Re: get top 5 i/o busy session - 01-29-2011 , 04:48 AM



We wrote a dirty little script we call "top10", called from the shell
as per the usage() statement:


usage()
{
echo "usage: top10 chunkio|chunkr|chunkw|mem|userrd|
userwr"
sleep
3
exit
}
case $#
in
1)
break;;
*)
usage;;
esac

getmemstats()
{
onstat -g ses|sort -n -r -k 7|head|grep "^[0-9]"|
\
awk '{printf "%8s %8s %8s %8s %8s\n", $1, $2, $4, $7, $8 }' >
t1.out
echo SID USER PID TOTMEM USEDMEM PROCESS |awk '{printf "%10s %10s
%10s %10s %10s %20s\n", $1, $2, $3, $4, $5,
$6 }'
while true;
do

dataline=`line`
[ $? -ne 0 ]&&
break
set
$dataline
if [ $3 -lt
0 ];then

proc=UNKNOWN

else
proc=`ps -fp$3|grep -v "PPID"|awk '{print
$NF}'`

fi
echo $1 $2 $3 $4 $5 $proc|awk '{printf "%10s %10s %10s %10s
%10s %20s\n", $1, $2, $3, $4, $5,
$6 }'
done <
t1.out
rm
t1.out
}

case $1
in
chunkio)
# chunk usage by overall I/
O:
echo "gfd pathname totalops dskread dskwrite io/
s";
onstat -g iof|sort -n -r -k6|
head;;
chunkr)
# chunk usage by
reads:
echo "gfd pathname totalops dskread dskwrite io/
s";
onstat -g iof|sort -n -r -k4|
head;;
chunkw)
# chunk usage by
writes:
echo "gfd pathname totalops dskread dskwrite io/
s";
onstat -g iof|sort -n -r -k5|
head;;
mem)
#
Memory
getmemstats;;
userrd)
# User Read
Activity
onstat -u|egrep -v " informix |Informix Dynamic|Userthreads|^$|address
"|sort -n -r -k 9|
head;;
userwr)
# User Write
Activity
onstat -u|egrep -v " informix |Informix Dynamic|Userthreads|^$|address
"|sort -n -r -k 10|
head;;
*)
usage;;
esac

Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.