Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Netty - Montreal Java User Group 2024-05-21

Netty - Montreal Java User Groupย 2024-05-21

Netty
Montreal Java User Group
2024-05-21

sullis

May 21, 2024

Transcript

106 slides
  1. ๐Ÿ“ Apache ActiveMQ Artemis ๐Ÿ“ Apache Bookkeeper ๐Ÿ“ Apache Camel

    ๐Ÿ“ Apache Cassandra ๐Ÿ“ Apache CXF ๐Ÿ“ Apache Druid
  2. ๐Ÿ“ Apache Flink ๐Ÿ“ Apache NiFi ๐Ÿ“ Apache Pinot ๐Ÿ“

    Apache Pulsar ๐Ÿ“ Apache Spark ๐Ÿ“ Apache Zookeeper
  3. And many othersโ€ฆ ๐Ÿ“ Apple Servicetalk ๐Ÿ“ Azure SDK for

    Java ๐Ÿ“ AWS SDK for Java (v2) ๐Ÿ“ async-http-client ๐Ÿ“ grpc-java ๐Ÿ“ Expedia Styx ๐Ÿ“ Play Framework ๐Ÿ“ reactor-netty ๐Ÿ“ vert.x ๐Ÿ“ gatling
  4. Netty core concepts โœ… io.netty.channel.Channel A nexus to a network

    socket or a component which is capable of I/O operations such as read, write, connect, and bind
  5. Netty core concepts โœ… io.netty.channel.ChannelPipeline A list of ChannelHandlers which

    handles or intercepts inbound events and outbound operations of a Channel
  6. Netty core concepts โœ… io.netty.channel.ChannelHandler Handles an I/O event or

    intercepts an I/O operation, and forwards it to its next handler in its ChannelPipeline
  7. High performance buffer pool Netty 4 introduces a high-performance buffer

    pool which is a variant of jemalloc https://netty.io/wiki/new-and-noteworthy-in-4.0.html
  8. High performance buffer pool โœ… Reduced GC pressure incurred by

    frequent allocation and deallocation of the buffers โœ… Reduced memory bandwidth consumption incurred when creating a new buffer which inevitably has to be filled with zeroes โœ… Timely deallocation of direct buffers https://netty.io/wiki/new-and-noteworthy-in-4.0.html
  9. Netty optional libraries Native transports ๐Ÿ“ epoll transport ๐Ÿ“ io_uring

    transport ๐Ÿ“ kqueue transport Other ๐Ÿ“ tcnative boringssl ๐Ÿ“ brotli4j ๐Ÿ“ zstd-jni
  10. TCP_NODELAY https://brooker.co.za/blog/2024/05/09/nagle.html if youโ€™re building a latency-sensitive distributed system running

    on modern datacenter-class hardware, enable TCP_NODELAY (disable Nagleโ€™s algorithm) without worries
  11. https://netty.io/wiki/reference-counted-objects.html Since Netty version 4, the life cycle of certain

    objects are managed by their reference counts, so that Netty can return them (or their shared resources) to an object pool (or an object allocator) as soon as it is not used anymore.
  12. โ€œThe disadvantage of reference counting is that it is easy

    to leak the reference-counted objectsโ€ source: Netty wiki
  13. Best practices to avoid leaks โ€œRun your unit tests and

    integration tests at PARANOID leak detection levelโ€ https://netty.io/wiki/reference-counted-objects.html
  14. HTTP/2 Rapid Reset โ€œEnsure relevant web server and operating system

    patches are deployed across all Internet-facing Web Serversโ€

More Decks by sullis

Other Decks in Programming