我在查看系统调用函数发现 redis的pconnect 长连接功能不生效
同样的代码 放在生产环境 就是正常的;
本地监测到 strace -p 20404 -s 1024
线上环境监测到strace -p 10404 -s 1024
线上环境显然没有去connect直接冒出句柄4
上线与本地php redis 版本都是一样的系统不一样
执行同样的PHP代码:
$ip = "127.0.0.1";
$port = 6379;
$redis = new Redis();
$redis->pconnect($ip, $port, 13);
$key = "test";
$value = "this is test";
$redis->set($key, $value);
$d = $redis->get($key);
var_dump($d);
$redis->close();
try{
$redis->get($key);
}
catch (Exception $e)
{
echo $e->getMessage();
}