[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] performance



On Tue, May 10, 2011 at 12:06:55AM +0200, Goswin von Brederlow wrote:
> Wouter Verhelst <w@...112...> writes:
> 
> > On Fri, May 06, 2011 at 11:10:29AM +0200, Folkert van Heusden wrote:
> >> Hi,
> >>  
> >> I have a suggestion for performance enhancement of NBD.
> >> The idea is that between each request the client and server exchange a
> >> message.  Since networks are slow, this takes a while.
> >
> > The current implementation works that way, because nbd-server is not
> > doing asynchronous reads, and therefore can only handle one request at a
> > time. But the protocol doesn't require it, and changing the
> > implementation so that it can handle one request while preparing to
> > handle another is what I meant with the performance improvements that I
> > mailed about earlier.
> 
> Does the kernel already pipeline requests?

I think so, but I'm not sure.

> >> Maybe we can, at least for write requests, send a couple of write
> >> commands with their data without immediately waiting for the reply and
> >> then if, say, 32 of them are send, wait for the acknowledgments.  If I
> >> remember correctly that's also how iSCSI does it.
> >
> > There's no reason to limit them to write requests only. However read and
> > write requests do need to remain somewhat ordered, otherwise there are
> > going to be some issues.
> 
> Two cases: read after write and write after read.

Write after read shouldn't be a problem, but read after write could.

> While I see that some bad implementation could read a block that is
> still writing I wonder if that could ever happen with linux? Wouldn't
> the data remain in cache as long as the NBD server hasn't acked the
> write?

Presumably, but that doesn't mean we shouldn't think this through. There
are systems other than the Linux kernel implementing the client side of
NBD, and they should not suddenly fail to work because of a
poorly-implemented asynchronous server.

-- 
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a



Reply to: