netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zacco <zacco@fw.hu>
To: Baruch Even <baruch@ev-en.org>
Cc: netdev@vger.kernel.org
Subject: Re: many sockets, slow sendto
Date: Tue, 20 Mar 2007 00:10:19 +0100	[thread overview]
Message-ID: <45FF185B.4070007@fw.hu> (raw)
In-Reply-To: <20070306182039.GJ25760@galon.ev-en.org>

Hi Baruch and all,

As you recommended, I used oprofile and it turned out that the 
__udp4_lib_lookup function spent most of the time. There is a udp hash 
table and the sockets are sought based on the 7 LSBs of the destination 
port number. So what happened is now quite obvious: I had many thousands 
of sockets, all with the same destination port, thus linked in the same 
slot of this hash table. I tried using different ports and it
was much faster then.

As the hash table seems to be about the proc fs, I tried to compile a 
kernel without that. I could start that kernel only with the 
init=/bin/bash option, otherwise many things did not work. My program 
stopped right after sending out the first packet, so the proc fs must be 
essential to the receive operation (but it might have been something 
else, too). If it is so, do you think I can remove the proc fs 
dependency that I can still use the regular socket functions (i.e. 
socket, connect, listen, send, recv etc)?

Now, I also understand why this receive related function is called right 
in the dev_queue_xmit function, where also some softirq happens, and 
both the send and receive part resided on the same host. As soon as I 
ran the test on two hosts, separating the send and receive sides, the 
considerable send delay simply disappeared. Could you help me to 
understand why? I expected the delay to appear on the receiving side, 
but it didn't.

The connection setup part (socket+connect) however still lineraly 
increased with the number of sockets. Hopefully, I can send you the 
oprofile result of this part, too, but in case you already have any idea 
of how I can get rid of this dependency, please, let me know!

thx a lot: Zacco


  reply	other threads:[~2007-03-19 23:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06 15:08 many sockets, slow sendto Zaccomer Lajos
2007-03-06 18:20 ` Baruch Even
2007-03-19 23:10   ` Zacco [this message]
2007-03-19 23:16     ` David Miller
2007-03-20 21:59       ` Zacco
2007-03-20 22:48         ` Eric Dumazet
2007-03-21 21:53           ` Zacco
2007-03-21 22:24             ` Eric Dumazet
2007-03-21 23:26             ` Eric Dumazet
2007-03-22  1:14             ` David Miller
2007-03-21 22:12           ` Eric Dumazet
2007-03-22  1:15             ` David Miller
2007-03-22  6:43               ` Eric Dumazet
2007-03-29 19:24             ` Zacco
2007-03-30 13:10               ` Eric Dumazet
2007-04-22 12:34                 ` Zacco
2007-04-30  7:26             ` David Miller
2007-04-30 10:56               ` YOSHIFUJI Hideaki / 吉藤英明
2007-04-30 12:47                 ` Eric Dumazet
2007-04-30 19:43                   ` YOSHIFUJI Hideaki / 吉藤英明
2007-04-30 19:59                     ` Eric Dumazet
2007-03-06 19:23 ` Andi Kleen
2007-03-06 21:28   ` Zacco

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=45FF185B.4070007@fw.hu \
    --to=zacco@fw.hu \
    --cc=baruch@ev-en.org \
    --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;
as well as URLs for NNTP newsgroup(s).