一.短连接开始测试 ab -n 5000 -c 100 -k 127.0.0.1/test_redis_short #demo1 Concurrency Level: Time taken for tests: 0.745 seconds Complete requests: Failed requests: Keep-Alive requests: Total transferred: bytes HTML transferred: bytes Requests per second: 670…
上篇文章[Thinkphp5实现悲观锁]已介绍过thinkphp5使用悲观锁实现高并发的场景,这篇文章将实际测试下. 在shell里进入到apache的bin目录,输入以下url: ab -n 100 -c 100 http://www.xyh.com/index/index/mysql_unlock [不加锁的情况,模拟100次请求,每次100个用户] 备注:如果提示socket: Too many open files (24),请执行ulimit -a,然后ulimit -n 1024.下…