public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: denys@visp.net.lb
To: Daniel Baluta <daniel.baluta@gmail.com>
Cc: <netdev@vger.kernel.org>
Subject: Re: 40k+ outbound connections and bind() problem
Date: Wed, 26 Jan 2011 14:35:29 +0200	[thread overview]
Message-ID: <9e62acde19ef75f3f77468cd81ed7ffd@visp.net.lb> (raw)
In-Reply-To: <AANLkTikSvf8bNK2_eHg+cWQJLz-56_88mrf0ttJX3W=0@mail.gmail.com>

 On Wed, 26 Jan 2011 14:23:44 +0200, Daniel Baluta wrote:
> Hi,
>
> On Wed, Jan 26, 2011 at 2:14 PM,  <denys@visp.net.lb> wrote:
>> I am running server (TCP accelerator), which is initiating more than 
>> 40K
>> connections.
>> Each instance of server bound to separate IP, and each of them 
>> handling
>> around 5-10K connections.
>> At moments, when i have excessive connect/disconnect events if i try 
>> to
>> establish connection even from IP is not used,
>> during bind() i am getting errno "Address already in use".
>> What can be the issue?
>> Will it help if i increase in kernel hardcoded limit from 64K TCP 
>> bind hash
>> entries to higher values?
>
> Please provide more information. What kernel version are you using?
> Are you  binding on a SO_REUSEADDR socket right?
 Latest stable, 2.6.37

 No, but trying with it now. At same time i think it is not correct, if 
 i try to bind to "unused" for any connections IP, and it will return 
 such error.
 It is not listening socket, it is outbound connection
 s = socket(...)
 memset(&name,0x0,sizeof(name));
 name.sin_family=AF_INET;
 name.sin_addr.s_addr=s_stx->src_ip;
 name.sin_port=0;
 bind()
 connect()

 Now i will try to put between socket and bind
 setsockopt(netsocket,SOL_SOCKET,SO_REUSEADDR,(void*)&tmpint,sizeof(tmpint));

 But IMHO it is not very correct for outgoing connections.

  reply	other threads:[~2011-01-26 12:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 12:14 40k+ outbound connections and bind() problem denys
2011-01-26 12:23 ` Daniel Baluta
2011-01-26 12:35   ` denys [this message]
2011-01-26 13:00     ` Daniel Baluta
2011-01-26 13:17       ` Eric Dumazet
2011-01-26 13:23         ` denys
2011-01-26 13:26           ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e62acde19ef75f3f77468cd81ed7ffd@visp.net.lb \
    --to=denys@visp.net.lb \
    --cc=daniel.baluta@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox