Generally speaking, the timeout time of the connect function refers to the link waiting time in TCP, that is, the link establishment time is 3 seconds. If the link is not successful in 3 seconds, the function returns.
In addition, by default, the server side of redis will automatically kill the link if there is no access for 5 seconds. The client side is not aware of this. It is best to judge the availability of the connection every time it is used; it is recommended to call it when there is no data access for 5 seconds. Ping/pang mechanism to prevent link failure;
There are many PHP drivers for redis => http://redis.io/clients#php I don’t know which one you are using. But written in the parameters of the connect method, it should be the timeout for establishing the link.
Generally speaking, the timeout time of the connect function refers to the link waiting time in TCP, that is, the link establishment time is 3 seconds. If the link is not successful in 3 seconds, the function returns.
In addition, by default, the server side of redis will automatically kill the link if there is no access for 5 seconds. The client side is not aware of this. It is best to judge the availability of the connection every time it is used; it is recommended to call it when there is no data access for 5 seconds. Ping/pang mechanism to prevent link failure;
There are many PHP drivers for redis => http://redis.io/clients#php I don’t know which one you are using.
But written in the parameters of the connect method, it should be the timeout for establishing the link.
Generally speaking, what comes with connect is the timeout of the connection.