Thousands of TIME_WAIT connections with CUPS?

View: New views
4 Messages — Rating Filter:   Alert me  

Thousands of TIME_WAIT connections with CUPS?

by Adam Nielsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

For some reason I'm getting thousands of hanging TCP connections on our
server which appear to be caused by Samba sending print jobs to CUPS (or
I assume so as nothing else on the machine uses CUPS.)

These connections are starting to cause problems (programs monitoring
connections start breaking because it takes many seconds for them to
scan through the full list) so if anyone has any ideas how to rid the
system of these connections I'd be very appreciative!

tcp    0   0 127.0.0.1:37256     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38323     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38251     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38495     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38445     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38818     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38748     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38573     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38359     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37863     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37743     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38035     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38961     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38473     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37984     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38804     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37514     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38307     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37991     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38673     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38054     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37808     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37632     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38069     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38464     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37559     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38713     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37998     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38556     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38162     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37566     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37597     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37939     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38599     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38867     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:37502     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38344     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38412     127.0.0.1:631      TIME_WAIT
tcp    0   0 127.0.0.1:38691     127.0.0.1:631      TIME_WAIT
...

Thanks,
Adam.
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Re: Thousands of TIME_WAIT connections with CUPS?

by Michael Wood-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/4 Adam Nielsen <adam.nielsen@...>:

> Hi all,
>
> For some reason I'm getting thousands of hanging TCP connections on our
> server which appear to be caused by Samba sending print jobs to CUPS (or
> I assume so as nothing else on the machine uses CUPS.)
>
> These connections are starting to cause problems (programs monitoring
> connections start breaking because it takes many seconds for them to
> scan through the full list) so if anyone has any ideas how to rid the
> system of these connections I'd be very appreciative!

I don't have an answer for your actual question, but if it takes
several seconds to get this list, it's probably because of DNS
queries, and using "-n" will speed it up dramatically.

--
Michael Wood <esiotrot@...>
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Re: Thousands of TIME_WAIT connections with CUPS?

by Adam Nielsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I don't have an answer for your actual question, but if it takes
> several seconds to get this list, it's probably because of DNS
> queries, and using "-n" will speed it up dramatically.

Thanks for the suggestion.  I was actually using "cat /proc/net/tcp" as
this is what the monitoring software uses, so there's no DNS lookups
there.  Just the sheer number of them (and any processing done by the
monitoring software) is the cause of the delay.

Adding -n when using 'netstat' only shaves off 0.3 seconds, I guess
because 99% of them are all "localhost"!

But of course the connections shouldn't be there in the first place, so
any ideas how to get rid of them would be much appreciated!  I am only
running Samba 3.2 though, so perhaps the problem will go away when I get
a chance to upgrade to 3.4...

Cheers,
Adam.
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Re: Thousands of TIME_WAIT connections with CUPS?

by Michael Wood-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/5 Adam Nielsen <adam.nielsen@...>:
>> I don't have an answer for your actual question, but if it takes
>> several seconds to get this list, it's probably because of DNS
>> queries, and using "-n" will speed it up dramatically.
>
> Thanks for the suggestion.  I was actually using "cat /proc/net/tcp" as
> this is what the monitoring software uses, so there's no DNS lookups
> there.  Just the sheer number of them (and any processing done by the
> monitoring software) is the cause of the delay.

Ah, OK.  Then is it possible to get your monitoring software to ignore
the 127.0.0.1:631 connections?

> Adding -n when using 'netstat' only shaves off 0.3 seconds, I guess
> because 99% of them are all "localhost"!
>
> But of course the connections shouldn't be there in the first place, so
> any ideas how to get rid of them would be much appreciated!  I am only
> running Samba 3.2 though, so perhaps the problem will go away when I get
> a chance to upgrade to 3.4...

I don't think that will help.

See the following:
http://www.developerweb.net/forum/showthread.php?t=2941
The diagram there is a bit corrupted from the original ASCII art
version (missing sequence numbers etc.), so see figure 13 from here:
http://tools.ietf.org/html/rfc793

See also:
http://www.developerweb.net/forum/showthread.php?t=5995
http://www.developerweb.net/forum/showthread.php?t=3752
http://blog.port80software.com/2004/12/07/hurry-up-and-time_wait/

--
Michael Wood <esiotrot@...>
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba