Home > Article > Backend Development > How to check the number of connections in redis and simulate concurrent creation of redis connections in 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); ?>
redisView current Number of connections
[root@localhost ~]# cd /usr/local/redis-3.0.6
[root@localhost src]# src/redis-cli info | grep connected_clients
connected_clients: 27
The above method of checking the number of redis connections and php simulating concurrent creation of redis connections is all the content shared by the editor. I hope it can give you a reference, and I hope you will support the PHP Chinese website.
For more related articles on how to view the number of redis connections and how to simulate concurrent creation of redis connections in PHP, please pay attention to the PHP Chinese website!