时间:2020-10-05 21:33:32 | 栏目:PHP代码 | 点击:次
max_redis.php
<?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