Yii redis 持久配置
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => '127.0.0.1',
'retries' => 3,
'port' => 6379,
'password' => '',
'socketClientFlags' => STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT,
],
predis redis 持久配置
$client = new \Predis\Client([
'scheme' => 'tcp',
'host' => $redis->hostname,
'port' => $redis->port,
'password' => $redis->password,
'persistent'=>true,
]);
phpredis redis 持久配置
$redis->pconnect('127.0.0.1', 6379);
Pingback引用通告: 解决nginx+php/java/go/python+mysql下time_wait连接数过多问题 | 为自己写代码