found a lot of students in use. NET is concerned with a problem when it comes to communication. NET can support how many online connections. In fact, the communication of. NET is supported by WinSocket, and since the low-level winsocket supports that, the limit of the number of access connections to the. NET end is fully limited by the WinSocket current operating system.
65535 of the limit?
Many students think that because the port is limited, the connected connection is limited by the port resource. In fact, for the server connection access is not to generate a port resource allocation, it only assigns the appropriate operating system handle. Therefore, the connections that can be connected will not be limited by the number of ports. In fact, win reserved the number of connections can be connected to the maximum value is still very large, through the following registry value can be learned
?
1 2 |
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters] TcpNumConnections = 0x00fffffe (Default = 16,777,214) |
From the value is the 1000多万个 access limit, of course, this is a value real on the current operating system and memory resources support so many handle instances is also hard to say ... Because the connected access is tightly created and assigned the corresponding handle resource. If the memory is large enough, it does support a lot of connections, and of course it requires the operating system to support managing so many instances of the handle.
Test
For some students said 6W connected to do a simple test
Judging from the test results. NET support this online connection number that is no pressure, a single connection every 10 seconds to interact with a message and some new connections to access, if no message interaction estimates CPU resources do not see a percentage.
The understanding of concurrency
In the communication process to find that everyone's understanding of concurrency is somewhat different, some students are concurrent is the number of simultaneous online connections, but some students understand the current service processing at the same time the amount of messages (seconds). Actually the difference between the two is very big. A simple example now that you have 10 customers, they come to you on the same day to talk about the business tired, not about time to talk about one of a tired? Although the overall workload is the same, the former is likely to cause a resource collapse that will prevent you from continuing to work .... Also in service processing, the same as the number of connections as long as there is no data interaction and logic processing only in memory to occupy a pit is not affect the CPU resources. Therefore, it is best to evaluate a service is based on the actual business, if the customer requires 10W online, and each customer 10 seconds to produce an interaction; that is a good evaluation of the hardware, but if the business is every customer every second to interact with a large number of business data, it is more difficult to plan from the hardware resources and bandwidth, Some feasibility tests may have to be done to evaluate them.