Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback for io_uring native transport #1786

Closed
QIvan opened this issue Jun 29, 2021 · 6 comments
Closed

Feedback for io_uring native transport #1786

QIvan opened this issue Jun 29, 2021 · 6 comments
Labels
for: team-attention An issue we need to discuss as a team to make progress

Comments

@QIvan
Copy link

QIvan commented Jun 29, 2021

Hi! as you told here

We'd love to hear from you how io_uring works out for you.

So I came here to share a bit of our experience:
First of all, thanks for this work, at the end of the day we were able to set everything up, it seems to be working and it reduces latency on our workloads by ~10-15%, cool! Special thanks for the flexibility, it's nice that one developer can work on Linux and use io_uring at the same time when another one can use Mac OS and falls back to Epoll or other transport.

But one thing works not really great:
on my end, I have

uname -a
Linux 5.8.0-55-generic #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

and our tests hang from time to time on my box with a log like this

## Lettuce Native Transports:
   --> io_uring availability: true
   --> epoll    availability: true

<some other logs here and at the moment we make a real connection to Redis:>

Unable to connect to [redis://127.0.0.1:5982]
java.lang.IllegalStateException: failed to create a child event loop
	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:88) ~[netty-common-4.1.65.Final.jar:4.1.65.Final]
	... bla-bla-bla a lot of stracktraces here 

Caused by: java.lang.RuntimeException: failed to create io_uring ring fd Cannot allocate memory
	at io.netty.incubator.channel.uring.Native.ioUringSetup(Native Method) ~[netty-incubator-transport-native-io_uring-0.0.5.Final-linux-x86_64.jar:0.0.5.Final]
	at io.netty.incubator.channel.uring.Native.createRingBuffer(Native.java:155) ~[netty-incubator-transport-native-io_uring-0.0.5
	... over 9000 more

the first 3 lines of the log above stand for code

LOG.info("## Lettuce Native Transports:");
LOG.info("   --> io_uring availability: {}", IOUringProvider.isAvailable());
LOG.info("   --> epoll    availability: {}", Epoll.isAvailable());

So, from time to time, Native transport can allocate io_uring, but the next moment it can't.
I saw a note on the netty Readme page about that, but anyhow, seems like the transport check is not sufficient.
For some colleagues of mine with a newer kernel, it works just fine.

I also saw that there is 0.0.6 version for netty transport I built it manually and seems like with this version, it works better, cos there is a kernel check > 5.9

Unfortunately, there is no 0.0.6 version in maven, so I can't verify its behaviour on some test env. I thought about using this issue as a reference for the netty guys why do I ask to upload the 0.0.6 version on maven.

Thanks once again, I would love to hear any thoughts about this one.

@QIvan
Copy link
Author

QIvan commented Jun 29, 2021

ah, sorry, forgot to mention. we use:

  • lettuce-core version 6.1.2.RELEASE
  • netty-incubator-transport-native-io_uring version 0.0.5.Final-linux-x86_64

@izemlyanskiy
Copy link

per netty/netty-incubator-transport-io_uring#105
netty-incubator-transport-native-io_uring skipped version 0.0.6 and just released version 0.0.7 which is on Maven Central already

@izemlyanskiy
Copy link

thanks @normanmaurer for the release, once again.
just for a record, could you provide a bit of information, why did you bump up minimal kernel requirement for io_uring?
Originally it was > 5.1 but now it's > 5.9

@normanmaurer
Copy link

@izemlyanskiy all the kernel release before 5.9 had some features missing or bugs that basically resulted in incorrect behaviour.

@mp911de
Copy link
Collaborator

mp911de commented Jul 1, 2021

Thanks a lot for sharing your experience. Going forward, we intend to pick up the latest io_uring version with our next release.

I'm not sure whether there's more that we could do in terms of determining io_uring availability.

@mp911de
Copy link
Collaborator

mp911de commented Jul 8, 2021

Closing that ticket, the dependency upgrade is addressed with #1798.

@mp911de mp911de closed this as completed Jul 8, 2021
@mp911de mp911de added the for: team-attention An issue we need to discuss as a team to make progress label Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: team-attention An issue we need to discuss as a team to make progress
Projects
None yet
Development

No branches or pull requests

4 participants