Viewing utilization per file descriptor on Solaris 10 hosts


While load-testing a MySQL back-end last weekend, I wanted to be able to monitor read and write utilization per file descriptor. The DTraceToolkit comes with a nifty script named pfilestat that does just that:

$ pfilestat 841

STATE FDNUM Time Filename
read 63 0% /tmp/#sql_349_0.MYI
write 64 0% /tmp/#sql_349_0.MYD
read 64 0% /tmp/#sql_349_0.MYD
write 63 0% /tmp/#sql_349_0.MYI
read 18 0%
write 18 0%
read 60 0% /opt/mysql/data/db/one
running 0 0%
waitcpu 0 9%
sleep 0 89%

STATE FDNUM KB/s Filename
read 63 0 /tmp/#sql_349_0.MYI
write 63 0 /tmp/#sql_349_0.MYI
read 18 0
write 64 0 /tmp/#sql_349_0.MYD
read 64 0 /tmp/#sql_349_0.MYD
write 18 7
read 60 181 /opt/mysql/data/db/one

Total event time (ms): 4263 Total Mbytes/sec: 0

In addition to displaying the amount of data that is read from or written to each file descriptor, pfilestat also provides information on how much time is spent sleeping and waiting for I/O. This is yet another reason why the DTraceToolkit is da shiznit!

This article was posted by Matty on 2006-11-10 19:08:00 -0400 -0400