As shown in the picture, I used golang's redigo library to write a redis connection pool, and used ab test to simulate 10,000 concurrent read operations. However, no matter how redis refreshes the info, the number of connections is always 2, and at most it only displays 4. However, there are more than 60 connections using write operations. At the same time, netstat-ano shows that there are indeed a large number of TCP connections in the TIME_WAIT state occurring on the remote 127.0.0.1:6379. What is the reason for this? (The maximum number of connections in the redis configuration is 10000)
(Please ignore the netstat window on the right. It was just that I didn’t take the screenshot properly. In fact, I found and filtered it myself and there were indeed a large number of TCP connections in the TIME_WAIT state occurring on the remote 127.0.0.1:6379)
PS: Another question is why the maximum -c parameter of the ab test program can only be 10,000. I entered 100,000 to directly display the help document. . .
Think the connection pool is not occupied?
Write like this