LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-04-2010, 10:38 AM   #1
pedrevans
LQ Newbie
 
Registered: Sep 2008
Location: Hamburg, Germany
Distribution: SuSE
Posts: 4

Rep: Reputation: 0
netstat shows multiple identical instances of a connection


We are running a combination of Apache-2 with mod_jk connecting to tomcat workers running on separate hardware.

Internet --- Apache/mod_jk --- tomcat

Strange: "netstat -tn" on the Apache server outputs identical combinations of source address, source port, destination address and destination port.

$ : count all TCP connections
$ netstat -tn | wc -l
4194
$ : count unique combinations of source/destination address/port
$ netstat -tn | sort | uniq -c | sort -n | wc -l
3846
$ : count only multiple occurrences of identical source/destination address/port
$ netstat -tn | sort | uniq -c | sort -n | awk '$1>1' | wc -l
210


I.e. I see lines like

tcp 0 0 10.198.40.64:443 10.198.40.3:26168 TIME_WAIT
tcp 0 0 10.198.40.64:443 10.198.40.3:26168 TIME_WAIT

usually separated by other lines. The states CLOSE_WAIT, ESTABLISHED, FIN_WAIT1, FIN_WAIT2 and TIME_WAIT are all affected.

The Apache server is running Debian.

$ uname -a
Linux webp05 2.6.18-6-amd64 #1 SMP Tue May 5 08:01:28 UTC 2009 x86_64 GNU/Linux

Has anybody else experienced this phenomenon? (I googled and searched LQ but couldn't find anybody else reporting this)

Should we be worried about it?

Is netstat broken, or is there another explanation?

We're scratching our heads here
 
Old 01-05-2010, 09:02 AM   #2
thePiet
LQ Newbie
 
Registered: Dec 2009
Posts: 25

Rep: Reputation: 15
http://www.developerweb.net/forum/showthread.php?t=2941

So when a connection is closed, it's state turns TIME_WAIT just to be really really sure that all the data has gone through.

Nothing to worry about I guess if you don't experience weird problems.
 
Old 01-06-2010, 03:46 AM   #3
pedrevans
LQ Newbie
 
Registered: Sep 2008
Location: Hamburg, Germany
Distribution: SuSE
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by thePiet View Post
http://www.developerweb.net/forum/showthread.php?t=2941

So when a connection is closed, it's state turns TIME_WAIT just to be really really sure that all the data has gone through.

Nothing to worry about I guess if you don't experience weird problems.
The issue is not the TIME_WAIT but the fact that netstat reports multiple instances of the same combination of source address, source port, destination address and destination port.

We're also seeing

tcp 0 0 10.198.41.4:59906 10.198.41.248:31289 ESTABLISHED
tcp 0 0 10.198.41.4:59906 10.198.41.248:31289 ESTABLISHED

and

tcp 0 1 10.198.40.32:80 87.167.207.96:1412 FIN_WAIT1
tcp 0 1 10.198.40.32:80 87.167.207.96:1412 FIN_WAIT1
 
Old 01-07-2010, 02:30 AM   #4
thePiet
LQ Newbie
 
Registered: Dec 2009
Posts: 25

Rep: Reputation: 15
Well, a browser can make multiple simultaneous connections to your webserver. Again, if your aren't experiencing any problems, why bother about this "issue" ?

The fact that nobody replies to your questions also tells that there's nothing to worry about
 
Old 01-07-2010, 05:05 AM   #5
pedrevans
LQ Newbie
 
Registered: Sep 2008
Location: Hamburg, Germany
Distribution: SuSE
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by thePiet View Post
Well, a browser can make multiple simultaneous connections to your webserver.
True, but each connection would have a different source port.
 
Old 01-07-2010, 11:36 PM   #6
jeff_k
Member
 
Registered: Jan 2008
Location: San Diego, CA USA
Distribution: Debian / Ubuntu
Posts: 51

Rep: Reputation: 17
In case it bothers you that a tcp connection is out there and you want to get rid of it, there is a handle linux app called "cutter".
http://www.lowth.com/cutter/

Pretty easy to install and use.
 
  


Reply

Tags
netstat


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Apache Instances piforever Red Hat 4 10-05-2008 08:18 AM
Multiple instances tekmann33 Linux - Newbie 1 01-28-2008 03:05 PM
Multiple Application Instances Think_UNIX General 0 09-26-2007 07:38 AM
kickstart; how-to info needed for multiple instances of RH OS's and multiple unique v Joe_Wulf Linux - Server 4 06-21-2007 11:18 PM
copying multiple different files in different directories with identical file names nickleus Linux - Software 4 03-09-2006 01:25 PM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration