Redis View the number of connections and how PHP simulates concurrent creation of REDIS connections

Source: Internet
Author: User
max_redis.php

<?phpset_time_limit (0); for ($i =1; $i <=1050; $i + +) {    exec ("Nohup php/var/www/html/big/link_redis.php >/dev/null &");}

link_redis.php

<?phpset_time_limit (0); $redis = new Redis (), $redis->pconnect (' localhost ', 6379), $redis->auth (' php001 '); Sleep (100);? >

Redis view 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

Above this Redis view the number of connections and PHP simulation concurrent creation of Redis connection is a small part of the whole content to share to everyone, I hope to give you a reference, but also hope that we support topic.alibabacloud.com.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.