If we do not write network communication applications, we believe that there is less contact with the connection pool. In fact, we often use the connection pool function, especially when using ado.net to access the database. the main function of the connection pool is to reuse n connections, instead of creating a connection every time you use it. By reducing connection creation, you can achieve a better network throughput.
The connection pool used in ado.net is for a single server, but in some cases the application is relatively complex, the logic is distributed on several servers, and the web distribution calls these logical server applications.
In this case, if the connection pool is only for a single server, it will be much more troublesome for the Web to maintain the connection pool of different servers. For example, if a node has an exception, we also need to discard abnormal node rounds. After the server returns to normal, we also need to consider a series of issues such as node back-to-queue at the call layer. to handle the preceding problems conveniently, add a multi-node connection pool in beetle to handle this situation.
When a node socket encounters a network exception, it can be determined that there is a problem with the cited node. During the round robin process, the pool determines whether to discard node Round Robin Based on the node status. you can check the node after the specified interval for the node recovery pool. If the node can be connected normally, the node is restored.
The above are general design ideas,CodeThis is only part of the process. If you have any experience or interest in this field, you can leave your comments and ideas empty.