On Wed, 16 Apr 2008, J Potter wrote:
> Is there an easy way to get a count of the number of active socket
> connections, or even better, number of socket connections in the time_wait
> state? (Something lightweight... under /proc/sys/net/ipv4/? I'd like to
avoid
> the impact of listing out all the connections a-la netstat.)
[dag at rhun ~]$ dstat -t --tcp
-----time----- ----tcp-sockets----
date/time |lis act syn tim clo
18-04 12:24:19| 4 9 0 4 0
18-04 12:24:20| 4 9 0 4 0
18-04 12:24:21| 4 9 0 4 0
18-04 12:24:22| 4 9 0 4 0
Although it is using /proc/net/tcp
You can use --debug to see how much time in milliseconds dstat spends on
getting that information. Of course that number is impacted by the load on
the system as well.
[dag at rhun ~]$ dstat -t --tcp --debug
Module dstat_time
Module dstat_tcp requires ['/proc/net/tcp', '/proc/net/tcp6']
-------time------- ----tcp-sockets----
date/time |lis act syn tim clo
18-04 12:26:17.932| 4 9 0 4 0 11.76ms
18-04 12:26:18.935| 4 9 0 4 0 25.83ms
18-04 12:26:19.936| 4 9 0 4 0 14.82ms
18-04 12:26:20.937| 4 9 0 4 0 14.51ms
Kind regards,
--
-- dag wieers, dag at centos.org, http://dag.wieers.com/ --
[Any errors in spelling, tact or fact are transmission errors]