Slow lsof on Solaris

If lsof is taking several minutes to complete on Solaris, make sure to download the latest package from Sunfreeware (or compile the latest version from source). The latest version can make a significant difference, such as this example on a Solaris 8 Sparc system.

lsof version 4.49:

# lsof -v
lsof version information:
    revision: 4.49 -- find the latest revision at:
        ftp://vic.cc.purdue.edu/pub/tools/unix/lsof
    configuration info: 64 bit kernel
    constructed: Sun May 14 20:55:07 EDT 2000
    constructed by and on: steve@solaris
    compiler: /opt/SUNWspro/bin/cc
    compiler version: WorkShop Compilers 5.0 98/12/15 C 5.0
    compiler flags: -Dsolaris=80000 -DHASPR_GWINDOWS -xarch=v9 -DHASIPv6 -DHAS_VSOCK -DLSOF_VSTR="5.8" -O
    loader flags: -L./lib -llsof -lkvm -lelf -lsocket -lnsl
    system info: SunOS solaris 5.8 Generic sun4u sparc SUNW,Ultra-5_10

# time /usr/local/bin/lsof -i :23
real     4:22.2
user     3:37.7
sys         6.0

lsof version 4.68:

# /usr/local/bin/lsof -v

lsof version information:
    revision: 4.68
    latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
    latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
    latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
    configuration info: 64 bit kernel
    constructed: Wed Jul 23 04:48:34 EDT 2003
    constructed by and on: steve@solaris
    compiler: gcc
    compiler version: 3.3
    compiler flags: -Dsolaris=80000 -DHASPR_GWINDOWS -m64 -DHASIPv6 -DHAS_VSOCK -DLSOF_VSTR="5.8" -O
    loader flags: -L./lib -llsof  -lkvm -lelf -lsocket -lnsl
    system info: SunOS solaris 5.8 Generic_108528-11 sun4u sparc SUNW,Ultra-5_10 Solaris

# time /usr/local/bin/lsof -i :23
real        4.1
user        0.8
sys         2.9

More information at Google Groups.

Back to brandonhutchinson.com.
Last modified: 08/11/2003