[HN Gopher] Use io_uring for network I/O
       ___________________________________________________________________
        
       Use io_uring for network I/O
        
       Author : mfiguiere
       Score  : 61 points
       Date   : 2023-04-12 21:35 UTC (1 hours ago)
        
 (HTM) web link (developers.redhat.com)
 (TXT) w3m dump (developers.redhat.com)
        
       | candiddevmike wrote:
       | Still waiting on io_uring in the Go stdlib:
       | https://github.com/golang/go/issues/31908
       | 
       | "Unplanned"
        
         | slashdev wrote:
         | Likewise for Mio (which underlies Tokio) for Rust. The odds of
         | that happening look better, but still seems far away.
        
         | tomohawk wrote:
         | We've been able to do a lot with this:
         | 
         | https://github.com/dshulyak/uring
        
       | victor106 wrote:
       | does anyone here know how to use this with Java? Does Java by
       | default use io_uring?
        
         | mfiguiere wrote:
         | io_uring will indeed be a perfect fit for Java: no need to pay
         | a supplemental JNI access cost for each IO as all you need is a
         | memory barrier to read or write the shared queues which can be
         | properly implemented in pure Java. We're not there yet but here
         | is where you can look:
         | 
         | - For network I/O, Netty has an incubating transport that is
         | promising [1].
         | 
         | - For disk I/O, JDK's Loom project [2] has mentioned its plan
         | to rely on io_uring on Linux [3], but there's no ETA AFAIK.
         | 
         | [1] https://github.com/netty/netty-incubator-transport-io_uring
         | 
         | [2] https://openjdk.org/projects/loom/
         | 
         | [3] https://cr.openjdk.org/~rpressler/loom/loom/sol1_part1.html
        
         | rotifer wrote:
         | I don't believe that Java currently uses it by default,
         | although I've seen discussion about possibly using it in the
         | future.
         | 
         | However, you might find these links useful:                   -
         | I built an ultra high performance HTTP server in Java, powered
         | by io_uring - https://old.reddit.com/r/java/comments/12f2h79/i_
         | built_an_ultra_high_performance_http_server_in/         -
         | server is here - https://github.com/bbeaupain/hella-http
         | - based on these bindings -
         | https://github.com/bbeaupain/nio_uring
         | 
         | I wouldn't be surprised if there are others.
        
       | HL33tibCe7 wrote:
       | HN's title "fixer" takes another victim. "Why you should use
       | io_uring for network I/O" is not semantically the same as "Use
       | io_uring for network I/O". You can't just swap one out for the
       | other.
        
         | pcl wrote:
         | * * *
        
       | DominoTree wrote:
       | io_uring is staggeringly fast, and still seeing massive
       | improvements regularly. Their work in related subsystems is also
       | yielding some fantastic gains:
       | 
       | https://www.phoronix.com/news/Linux-Pipes-IOCB_NOWAIT
        
         | eatonphil wrote:
         | Jens Axboe's Twitter is another great place to follow for
         | improvements.
         | 
         | https://twitter.com/axboe
        
       ___________________________________________________________________
       (page generated 2023-04-12 23:00 UTC)