Hit*_*vda 7 php mysql performance
假设我有一个名为mysql_query_performance.php的页面,其中包含从表中选择一些记录并回显它的代码.
但我想知道如何模拟多个请求来测试该查询的性能?
这可能吗?如果是,怎么样?
对于简单的负载测试,您可能想尝试Apache Bench.它很可能已经安装在您的系统上.
ab -n 4000 -c 10 http://www.yoursite.com/mysql_query_performance.php
Run Code Online (Sandbox Code Playgroud)
这是为了一次执行10个请求(同时)