Sunday, March 15, 2015

Solaris: How to identify if a particular process/application is performing RAMDOM I/O or SEQUENTIAL I/O?


Solution: truss

RAMDOM I/O

#truss –p <PID>
----------------------------SNIP--------------------------------------------
sigprocmask(SIG_BLOCK, 0xFFBE6D7C, 0x00000000)  = 0
setitimer(ITIMER_REAL, 0xFFBE6D04, 0x00000000)  = 0
sigprocmask(SIG_UNBLOCK, 0xFFBE6D7C, 0x00000000) = 0
lseek(9, 2560, SEEK_SET)                        = 2560
read(9, "\0\n\0\0\0\0\0 D\001\0\0".., 512)      = 512
write(13, "\0\v\0\0\f\0\0\001\001", 11)         = 11
write(13, "\0\v\0\0\f\0\0\001\002", 11)         = 11
read(13, "\0\v\0\0\f\0\0\001\002", 2064)        = 11
lseek(9, 2560, SEEK_SET)                        = 2560
read(9, "\0\n\0\0\0\0\0 D\001\0\0".., 512)      = 512
lseek(9, 117760, SEEK_SET)                      = 117760
read(9, "\0\n19 n\0\0\0 D19 o\0\0".., 512)      = 512
lseek(9, 117760, SEEK_SET)                      = 117760
read(9, "\0\n19 n\0\0\0 D19 o\0\0".., 512)      = 512
write(13, "\0B3\0\006\0\0\0\0\004\0".., 179)    = 179
read(13, "\092\0\006\0\0\0\0\003 ^".., 2064)    = 146
write(13, "\0 B\0\006\0\0\0\0\0\v05".., 66)     = 66
read(13, "\09E\0\006\0\0\0\0\011 i".., 2064)    = 158
pread64(406, "0602\0\00201A3E0\0 B O9D".., 8192, 0x347C0000) = 8192
pread64(406, "0602\0\002\0B7 0\0 B O9B".., 8192, 0x16E60000) = 8192
pread64(406, "0602\0\002\0B7 1\0 B O9B".., 8192, 0x16E62000) = 8192
----------------------------SNIP--------------------------------------------
If you see "lseek" system calls being made, then the system is performing a "RANDOM I/O".
In a RANDOM I/O operation, "lseek" system calls will be made either BEFORE the READ or WRITE system calls.

SEQUENTIAL I/O
#truss –p <PID>
    
Here, you would find only "READ" & "WRITE" system calls. No "lseek" system calls will be executed.

 

SEQUENTIAL I/O    =    Read, Write
RANDOM I/O    =    Read, Write, lseek

No comments:

Post a Comment