max_redis.php
link_redis.php
redis查看当前连接数
[root@localhost ~]# cd /usr/local/redis-3.0.6
[root@localhost src]# src/redis-cli info | grep connected_clients
connected_clients:27
<?php
set_time_limit (0);
for($i=1;$i<=1050;$i++){
exec("nohup php /var/www/html/big/link_redis.php > /dev/null &");
}
link_redis.php
<?php
set_time_limit (0);
$redis = new redis();
$redis->pconnect('localhost', 6379);
$redis->auth('php001');
sleep(100);
?>
redis查看当前连接数
[root@localhost ~]# cd /usr/local/redis-3.0.6
[root@localhost src]# src/redis-cli info | grep connected_clients
connected_clients:27