In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about how to analyze Netty, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
About Netty ByteBuf: byte buffers can be divided into
1. Heap memory byte buffer, memory allocation and recycling speed JVM automatic recovery, the disadvantage is that IO needs to do an extra memory copy when reading and writing, and reinstate the cache area corresponding to heap memory to the kernel channel.
2, direct memory byte buffer, non-heap memory, memory allocation outside the heap, allocation and recycling will be slower, but due to the lack of memory reinstatement during reading, the speed is faster than heap memory. DirectByteBuf is used in the read-write buffer of the IO communication thread, and HeapByteBuf is used in the back-end business message codec module.
Channel: network IO read and write related interface
High performance of Netty
1. It adopts asynchronous non-blocking IO class library, which is implemented based on Reactor pattern and multiplexed.
2. TCP accept and send buffers use direct memory instead of heap memory to avoid memory replication and improve IO read and write performance.
3. Support recycling ByteBuf through memory pool to avoid performance loss caused by frequent creation and destruction of ByteBuf.
4. Using ring array buffer to realize lock-free concurrent programming.
...
The master-slave Reactor multithreading model is as follows
Https://blog.csdn.net/prestigeding/column/info/15042
The above is how to analyze Netty, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.