]> git.proxmox.com Git - mirror_iproute2.git/commit
ss -p is much too slow
authorSteve Fink <sphink@gmail.com>
Wed, 9 Jun 2010 18:42:38 +0000 (11:42 -0700)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Sun, 1 Aug 2010 02:31:12 +0000 (19:31 -0700)
commitfbc0f876fa011ef5f848911bd41b3033bf418bab
tree072d605ac11a29c1bbf1f2fdc562925673a23c17
parent1a7943bcf3edbe160747eee6d2037f5da1af6502
ss -p is much too slow

> On closer inspection, it appears that ss -p does a quadratic scan. It
> rescans every entry in /proc/*/fd/* repeatedly (once per listening
> port? per process? I don't remember what I figured out.)
>
> I humbly suggest that this is not a good idea.

Yep, this is junk.  Please give this patch a try:

ss: Avoid quadradic complexity with '-p'

Scan the process list of open sockets once, and store in a hash
table to be used by subsequent find_user() calls.

Reported-by: Steve Fink <sphink@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
misc/ss.c