It takes a long time to establish a connection when the application start
Closed this issue · 0 comments
When the read-write separation function is used (role=rr is configured in the url), it takes a long time (more than 10s) to establish a connection for the first time.
There may be the following problems with loadTablets in TopologyWatcher:
-
VtHealthCheckExecutorService, its cole-pool-size is set using Runtime.getRuntime().availableProcessors() method. This method obtains the number of cores of the physical machine in the early jdk version, and after Java SE 8u131 and JDK 9, the method obtains the number of cores of the container.
-
If there are a lot of Tablets in the cell (for example, there are thousands of Tablets), but the user only cares about one or two of them, the current method is to obtain all the Tablets in the cell one by one in a concurrent way for matching. This process consumes a lot of time.