[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070215191059.GB23953@2ka.mipt.ru>
Date: Thu, 15 Feb 2007 22:10:59 +0300
From: Evgeniy Polyakov <johnpol@....mipt.ru>
To: bert hubert <bert.hubert@...herlabs.nl>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Arjan van de Ven <arjan@...radead.org>,
Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@....com.au>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Ulrich Drepper <drepper@...hat.com>,
Zach Brown <zach.brown@...cle.com>,
"David S. Miller" <davem@...emloft.net>,
Benjamin LaHaise <bcrl@...ck.org>,
Suparna Bhattacharya <suparna@...ibm.com>,
Davide Libenzi <davidel@...ilserver.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 05/11] syslets: core code
On Thu, Feb 15, 2007 at 07:46:56PM +0100, bert hubert (bert.hubert@...herlabs.nl) wrote:
> 1) batch, and wait for, with proper error reporting:
> socket();
> [ setsockopt(); ]
> bind();
> connect();
> gettimeofday(); // doesn't *always* happen
> send();
> recv();
> gettimeofday(); // doesn't *always* happen
>
> I go through this sequence for each outgoing powerdns UDP query
> because I need a new random source port for each query, and I
> connect because I care about errrors. Linux does not give me random
> source ports for UDP sockets.
What about a setsockopt or just random port selection patch? :)
> When async, I can probably just drop the setsockopt (for
> nonblocking). I already batch the gettimeofday to 'once per epoll
> return', but quite often this is once per packet.
>
> 2) On the client facing side (port 53), I'd very much hope for a way to
> do 'recvv' on datagram sockets, so I can retrieve a whole bunch of
> UDP datagrams with only one kernel transition.
>
> This would mean that I batch up either 10 calls to recv(), or one
> 'atom' of 10 recv's.
>
> Both 1 and 2 are currently limiting factors when I enter the 100kqps domain
> of name serving. This doesn't mean the rest of my code is as tight as it
> could be, but I spend a significant portion of time in the kernel even at
> moderate (10kqps effective) loads, even though I already use epoll. A busy
> PowerDNS recursor typically spends 25% to 50% of its time on 'sy' load.
>
> This might be due to my use of get/set/swap/makecontext though.
It is only about one syscall in get and set/swap context, btw, so it
should not be a main factor, doesn't it?
As an advertisement note, but if you have a lot of network events per epoll
read try to use kevent - its socket notifications do not require
additional traverse of the list of ready events as in poll usage.
> Bert
>
> --
> http://www.PowerDNS.com Open source, database driven DNS Software
> http://netherlabs.nl Open and Closed source services
--
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists