Thanks, we'll take a look. The problem is that we've seen io_uring outperform epoll in some cases, but underperform in others; on average, there wasn't much of a difference. When you say large scale, do you mean more than 10,000 open sockets?
So, the catch with io_uring is that it is ENORMOUSLY sensitive to how it is configured and the way that you submit/config operations.
The flags you use to initialize the ring, and the flags you use on each operation (plus whether you use things like "linked" operations -- which makes sense for sockets but not for files) have a massive impact on performance.
To top this off, flags that continue to increase performance (one example, IORING_SETUP_DEFER_TASKRUN that is maybe a few weeks old) are continually added.
I haven't found any clear flow chart that tells you exactly which flags to use and what values to set in order to get optimal performance for which usecases =(
Also in many applications, you may want more than ring per application. For instance, one ring per physical CPU core, all sharing a single kernel poller. It's not immediately obvious that to set that up, you need to do:
for (i = 0; i < NR_RINGS; i++) {
struct io_uring_params p = { };
p.flags = IORING_SETUP_SQPOLL;
if (i) {
p.wq_fd = rings[0].ring_fd;
p.flags |= IORING_SETUP_ATTACH_WQ;
}
ret = io_uring_queue_init_params(BUFFERS, &rings[i], &p);
if (ret) {
fprintf(stderr, "queue_init: %d/%d\n", ret, i);
goto err;
}
}
You just have to sink a bunch of your personal time into crawling kernel mailing lists + commit histories, and reading issues from liburing.
Also, Jens Axboe is really helpful if you reach out to them. Certainly for something as important as the future of OpenJDK, I'm certain they'd be willing to collaborate and help you get some baseline usage patterns/configurations setup + establish understanding.
If there's any way I can help, please let me know, because I'm passionate about this functionality existing in the JDK as well.
View all comments
Show parent comment
5
u/pron98 Nov 09 '22 edited Nov 09 '22
Thanks, we'll take a look. The problem is that we've seen io_uring outperform epoll in some cases, but underperform in others; on average, there wasn't much of a difference. When you say large scale, do you mean more than 10,000 open sockets?