IO-Uring Archive on lore.kernel.org
 help / color / Atom feed
* io_uring_prep_writev
@ 2019-11-24 15:34 Mark Reed
  2019-11-24 16:42 ` io_uring_prep_writev Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Reed @ 2019-11-24 15:34 UTC (permalink / raw)
  To: io-uring


Jens et al,

I wrote a C event loop library based on io_uring and a KV store similar to memcached using it.  Mrcache is 4x faster using io_uring vs epoll so thank you guys for the work on this. I'm looking forward to 5.5 and am testing on 5.2.14 right now.

https://github.com/MarkReedZ/mrloop
https://github.com/MarkReedZ/mrcache

I'm currently using write instead of io_uring_prep_writev when writing to the socket and have a couple questions:

1.  If I queue up 50 writevs to a socket will they write in order?

2.  If the client backs up will those writevs return or will they simply wait?  

3.  Would you expect io_uring_prep_writev to be faster than using write on the socket?  My initial benchmarks had a 50 deep GET pipeline which would do a single writev with 50 iovs and that was slower than copying to an output buffer and looping on write when full.  Perhaps I had something wrong with the benchmark at the time - if you think so I'll try again.

Thanks again,

Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: io_uring_prep_writev
  2019-11-24 15:34 io_uring_prep_writev Mark Reed
@ 2019-11-24 16:42 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2019-11-24 16:42 UTC (permalink / raw)
  To: Mark Reed, io-uring

On 11/24/19 8:34 AM, Mark Reed wrote:
> 
> Jens et al,
> 
> I wrote a C event loop library based on io_uring and a KV store
> similar to memcached using it.  Mrcache is 4x faster using io_uring vs
> epoll so thank you guys for the work on this. I'm looking forward to
> 5.5 and am testing on 5.2.14 right now.
> 
> https://github.com/MarkReedZ/mrloop
> https://github.com/MarkReedZ/mrcache

Nifty! Thanks for sharing.

> I'm currently using write instead of io_uring_prep_writev when writing
> to the socket and have a couple questions:
> 
> 1.  If I queue up 50 writevs to a socket will they write in order?

Since it's a ring, they will be consumed in order. But with async
execution etc, there's no guarantee that they end up being done in
order. If you have dependencies like that, you probably what to use
links (IOSQE_IO_LINK).

> 2.  If the client backs up will those writevs return or will they
> simply wait?

They will do they same as a regular writev() would do, there should be
no difference there.

> 3.  Would you expect io_uring_prep_writev to be faster than using
> write on the socket?  My initial benchmarks had a 50 deep GET pipeline
> which would do a single writev with 50 iovs and that was slower than
> copying to an output buffer and looping on write when full.  Perhaps I
> had something wrong with the benchmark at the time - if you think so
> I'll try again.

That result does sound a bit odd, but would probably need to take a
closer look to render any real opinion on that.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-24 15:34 io_uring_prep_writev Mark Reed
2019-11-24 16:42 ` io_uring_prep_writev Jens Axboe

IO-Uring Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/io-uring/0 io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ https://lore.kernel.org/io-uring \
		io-uring@vger.kernel.org
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.io-uring


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git