FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 04-16-2008, 08:35 PM
Test
 
Default count of active tcp sockets?

netstat -an|grep TIME_WAIT|wc ?
--
Test <test@remedial-teacher.nl>

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-16-2008, 09:18 PM
J Potter
 
Default count of active tcp sockets?

netstat -an|grep TIME_WAIT|wc ?


I need to avoid anything that lists out all the connections -- the
above would take too long if there are tens of thousands of connections.


I'm hoping there's a proc entry that has a summary count of the
current number of connections?


-Jeff

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-16-2008, 09:29 PM
"Ross S. W. Walker"
 
Default count of active tcp sockets?

J Potter wrote:
>
> > netstat -an|grep TIME_WAIT|wc ?
>
> I need to avoid anything that lists out all the connections -- the
> above would take too long if there are tens of thousands of
> connections.
>
> I'm hoping there's a proc entry that has a summary count of the
> current number of connections?

With the -n added to the option it won't resolve IPs so it
shouldn't take that long, but otherwise:

cat /proc/net/sockstat
sockets: used 284
TCP: inuse 16 orphan 0 tw 0 alloc 18 mem 1
UDP: inuse 12
RAW: inuse 1
FRAG: inuse 0 memory 0

I believe the tw is the time_wait count, just:

awk '/TCP:/ {print $7}' /proc/net/sockstat

-Ross

__________________________________________________ ____________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-18-2008, 10:26 AM
Dag Wieers
 
Default count of active tcp sockets?

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@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@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@centos.org, http://dag.wieers.com/ --
[Any errors in spelling, tact or fact are transmission errors]
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 12:07 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org