FAQ
I tested your sample and could get a 128997 established connections, but
this is only 63964 outgoing connections. This is about the same result as
with my test but you now have doubled this by counting incoming and
outgoing connections.

2013/08/21 06:54:20 starting listeners
2013/08/21 06:54:20 listeners started, starting clients
2013/08/21 06:54:20 clients started, waiting for completion
2013/08/21 06:54:23 client 127.0.0.106:0: connection *7993*: dial tcp
127.0.0.206:8000: address already in use
2013/08/21 06:54:23 client 127.0.0.107:0: connection *7993*: dial tcp
127.0.0.207:8000: address already in use
2013/08/21 06:54:24 client 127.0.0.102:0: connection *7993*: dial tcp
127.0.0.202:8000: address already in use
2013/08/21 06:54:24 client 127.0.0.103:0: connection *7996*: dial tcp
127.0.0.203:8000: address already in use
2013/08/21 06:54:24 client 127.0.0.100:0: connection *7995*: dial tcp
127.0.0.200:8000: address already in use
2013/08/21 06:54:24 client 127.0.0.104:0: connection *7997*: dial tcp
127.0.0.204:8000: address already in use
2013/08/21 06:54:24 client 127.0.0.101:0: connection *7999*: dial tcp
127.0.0.201:8000: address already in use
2013/08/21 06:54:24 client 127.0.0.105:0: connection *7998*: dial tcp
127.0.0.205:8000: address already in use

  --------- +

  *63964*
*
*
2013/08/21 06:54:24 All clients connected, pausing now to let you
investigate the process

2013/08/21 06:54:24 sockets: used 129118 TCP: inuse 129023 orphan 11 tw 2
alloc 129025 mem 1774 UDP: inuse 0 mem 0 UDPLITE: inuse 0 RAW: inuse 0
FRAG: inuse 0 memory 0

ESTABLISHED 128997

As soon I extend the number of source and target addresses I get the
following:

2013/08/21 07:30:19 starting listeners
2013/08/21 07:30:19 listeners started, starting clients
2013/08/21 07:30:19 clients started, waiting for completion
2013/08/21 07:30:23 client 127.0.0.106:0: connection *6395*: dial tcp
127.0.0.206:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.101:0: connection *6395*: dial tcp
127.0.0.201:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.103:0: connection *6397*: dial tcp
127.0.0.203:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.102:0: connection *6395*: dial tcp
127.0.0.202:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.105:0: connection *6396*: dial tcp
127.0.0.205:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.104:0: connection *6394*: dial tcp
127.0.0.204:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.109:0: connection *6391*: dial tcp
127.0.0.109:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.100:0: connection *6394*: dial tcp
127.0.0.200:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.108:0: connection *6392*: dial tcp
127.0.0.108:8000: address already in use
2013/08/21 07:30:23 client 127.0.0.107:0: connection *6391*: dial tcp
127.0.0.207:8000: address already in use

  --------- +

  *63940*

2013/08/21 07:30:23 All clients connected, pausing now to let you
investigate the process

2013/08/21 07:30:23 sockets: used 129137 TCP: inuse 129036 orphan 11 tw 0
alloc 129038 mem 1778 UDP: inuse 0 mem 0 UDPLITE: inuse 0 RAW: inuse 0
FRAG: inuse 0 memory 0



On Wed, Aug 21, 2013 at 7:40 AM, Dave Cheney wrote:

Please try this sample code

http://play.golang.org/p/y2319158oP

I get to 114688 connections without any serious tcp tuning.

On Wed, Aug 21, 2013 at 9:13 AM, Benjamin Measures
wrote:
On Tuesday, 20 August 2013 10:19:44 UTC+1, Paul van Brouwershaven wrote:

2013/08/20 08:57:46 sockets: used 64723 TCP: inuse 64542 orphan 31 tw 0
alloc 64632 mem 771 UDP: inuse 0 mem 0 UDPLITE: inuse 0 RAW: inuse 0
FRAG:
inuse 1 memory 1480
2013/08/20 08:58:30 sockets: used 64407 TCP: inuse 62746 orphan 31 tw 0
alloc 64316 mem 772 UDP: inuse 0 mem 0 UDPLITE: inuse 0 RAW: inuse 0
FRAG:
inuse 0 memory 0

The TCP sockets inuse has decreased. This would suggest sockets are being
closed.
When I run the test program with 64100 routines I can even get to 64632
but soon run into the error "address already in use" error.

2013/08/20 09:07:33 sockets: used 708 TCP: inuse 614 orphan 30 tw 0
alloc
616 mem 770 UDP: inuse 0 mem 0 UDPLITE: inuse 0 RAW: inuse 0 FRAG:
inuse 0
memory 0
2013/08/20 09:08:04 sockets: used 64807 TCP: inuse 64632 orphan 30 tw 4
alloc 64715 mem 771 UDP: inuse 0 mem 0 UDPLITE: inuse 0 RAW: inuse 0
FRAG:
inuse 0 memory 0
2013/08/20 09:08:23 *.*.*.1 -> 10.5.175.151 || dial tcp 10.5.175.151:80
:
address already in use

Using more goroutines will cause connections to be opened (and closed) at a
greater rate. That the error doesn't appear until ~20s after peak/high
inuse, would support the CLOSE_WAIT issue as outlined earlier in this
thread.
--
You received this message because you are subscribed to a topic in the
Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/golang-nuts/Mi7QkAqP7II/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
Regards,

Paul van Brouwershaven

http://linkedin.com/in/pvanbrouwershaven
http://facebook.com/p.vanbrouwershaven
http://twitter.com/vanbroup

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 31 of 39 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 16, '13 at 10:45a
activeAug 21, '13 at 9:47a
posts39
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase