NIO was originally the abbreviation for New input/output. However, the Java API has been around for a long time and it is no longer new.
Now commonly used abbreviations to represent nonblocking I/O (non-blocking I/O). On the other hand, the general (including the author) refers to blocking I/O
OIO or Old input/output. You may also encounter normal I/O.
We have shown an example of I/O blocking in Java. Figure 1.1 shows how the method must be extended to handle multiple connections: to each connection
Create a thread, some connections are idle! Obviously, the scalability of this approach will be limited by the number of threads that can be created in the JVM.
This scheme is acceptable when you have fewer connections in your app. when the concurrent connection exceeds 10000, the contextswitching (
context switch) overhead will be obvious. In addition, each thread has a default stack memory allocated for 128K and 1M
The space between. Considering that the overall memory and operating system need to handle 100,000 or more concurrent connection resources, it seems to be a
The ideal solution.
1 x 16G Notebooks:
Avalible:16 G * 1024x768 m/g = 16384 M
min:128 K (0.125 m)/thread * 10000 Thread = 1250 m
max:1024 K (1 M)/thread * 10000 Thread = 10000 M
Maximum memory, which occupies more than half of the available memory.
Essential Netty in action "Netty actual Combat (Essence)" Reading notes one