Hi everybody, I'm
方圆
table of Contents
1. Applicable scenarios of the three models
- BIO: Suitable for a small number of connections, and the server resources are sufficient for the connections we know, and the development is simple
- NIO: Compared with BIO, development is more difficult, but the number of customer connections is relatively high. It is worth noting that because NIO is a single thread polling to process data, it is necessary to avoid too long each task execution time and prevent other threads from waiting too long
- AIO: The number of connections accepted is large. Compared with NIO, it is asynchronous. It can accept a task that takes too long, but the development is more difficult and the maintenance is not easy.
- Attachment: You can use VisualVM under the JDK folder to monitor the usage of the program
end