Since Java 1.4, the JDK has supported NIO(NEW IO). NIO(OS Nonblocking) allows application servers to greatly optimize the threading model. Compared to the traditional blocking IO thread and link to link mode, NIO requires only a small number of threads to process all links. This is a great boon for Java developers, who can develop more efficient web applications based on NIO.

However, using the JDK native API to develop NIO, the programming model is very complex, developers need to understand the Selector, Channel, ByteBuffer three components, in addition to the JDK native NIO implementation there are some stability problems. Netty encapsulates the three component interaction codes inside the framework, which effectively simplifies the programming model so that users can develop NIO network applications more efficiently and ensure the stability of the system.

However, with the new problems, for developers, the framework is easy to use, shielding the underlying details, in return for a lack of in-depth understanding of the principle, performance tuning and theory of the weak, many excellent online products dubbo, Spark, ZooKeeper, elasticSearch, etc., With the use of Netty as the support for the underlying communication IO framework, the underlying principles of Netty are becoming more and more urgent, especially in the interview process.

However, many Netty related knowledge points and work skills, an article is difficult to complete. This small series for Netty technical knowledge difficulties specially share a PDF document “Netty source code analysis and actual combat document”, which involves Netty start and stop, Netty memory, Netty concurrent multi-threading, Netty performance, Netty reliability, Netty security and so on

This document is divided into 18 parts, in order not to affect the reading, in the form of screenshots to show the catalog and part of the content, sorting and collecting is not easy to need friends to help forward attention to the end of the public number for it

Part I and Part II

The main contents include: Netty server exit unexpectedly, Nty exit gracefully, Netty connection pool resource leak, Netty client creation mechanism

Part III and Part IV

The main contents include: Leakage of Netty memory pool, working mechanism of Netty memory pool, use of HTTP protocol stack ByteBuf, implementation mechanism of Netty ByteBuf

Part FIVE and Part six

The main contents include cases of Netty sending queue backlog, Working mechanism of Netty message sending, fluctuation of high concurrent test performance, and memory application mechanism of Netty message access

Part seven and Part eight

The main contents include Netty ChannelHandler concurrency security issues, Netty ChannelHandler working mechanism, and Failure of the Internet of vehicles server to receive messages from on-board terminals. NioEventL OOP Thread I mechanism

Part nine through Part twenty

The main contents include:

  • Netty 3.X upgrade case
  • Netty performance Degradation caused by concurrent failure
  • LoT million long connection performance tuning case
  • Performance degradation caused by improper static check modification
  • Netty Performance Statistics Error Cases
  • GRPC Netty HTTP/2 practice case
  • Netty Event triggering policies are incorrectly used
  • Netty traffic shaping example
  • Netty SSL application case
  • Netty HTTPS server Breakdown case with high Concurrency
  • The access timeout case of the MQTT service
  • Summary of Netty practice

Netty interview

Compile a list of Netty interview questions that are commonly used in Internet programming interviews. From basic to advanced, if you can answer all the questions, you are very proficient, and even on the verge of becoming proficient in Netty. In order not to affect the reading, in the form of screenshots to show the catalog and part of the content, collation and collection is not easy to need friends to help forward after paying attention to the end of the public account to obtain it

basis


  • The difference between TCP and UDP?
  • How does TCP ensure reliable transmission?
  • TCP handshake, wave mechanism?
  • What is the cause of TCP sticky/unpack and the solution?
  • Netty sticky/unpack is how to handle, what are the implementation?
  • What is the difference between synchronous and asynchronous, blocking and non-blocking?
  • What about the network IO model?
  • What are BIO, NIO and AIO?
  • What are the mechanisms and differences between SELECT, poll and epoll?
  • What do you know about Netty?
  • How is Netty different from Java NIO? Why not just use the JDK NIO library?
  • What are Netty components and their associations?
  • What is the implementation process of Netty?

senior


  • What is Netty’s high performance reflected in?
  • What is Netty’s threading model like?
  • Where is Netty’s zero-copy implementation, and how is it different from operating systems?
  • How is Netty’s memory pool implemented?
  • How to implement Netty object pool?

In actual combat


  • How do you use Netty in your actual projects?
  • What problems have you encountered with Netty?

How to learn Netty

Learning the inner workings of Netty and figuring out how it works is a lengthy process, because it requires not only high-level knowledge of Java programming, but also network knowledge. At the same time, Netty contains various algorithms and optimization strategies, which is also one of the difficulties in Netty learning.

Like to point a focus on a thumbs-up support bar! Follow the public account below to obtain