Locating pipe endpoints


While debugging a performance problem this week, I noticed that one of our applications was issuing 1000s of read and write system calls each minute to file descriptor 19. To get a better idea of what file descriptor 19 was used for, I used the trusty Solaris pfiles utility:

$ pfiles 8988

[ ..... ]

19: S_IFIFO mode:0000 dev:291,0 ino:382227 uid:911116 gid:315 size:0 O_RDWR

Well this is interesting, the application is reading and writing to a pipe. But what resides on the remote side of the pipe? To answer this question, I passed the “ino” numeric argument to find’s “-inum” option:

$ find /proc -inum 382227 2>/dev/null

/proc/8996/fd/0
/proc/8995/fd/0
/proc/8988/fd/20

Once I located the process identifiers, I used the ps command to locate the pipe endpoints:

$ ps -ef | egrep '(8995|8996|8988)'

app 8996 8995 0 06:20:31 ? 0:00 /opt/VENDOR/logging.binary
app 8995 8988 0 06:20:31 ? 0:00 /bin/sh -c /opt/VENDOR/logging.binary
app 8988 1 1 06:20:31 ? 5:48 /opt/VENDOR/application

This definitely explains why they are issuing lots of writes, but why reads? Only the vendor can tell. :)

This article was posted by Matty on 2006-03-11 01:00:00 -0400 -0400