Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使用ab进行网站基准测试_Linux_Performance_Apache_Benchmarking - Fatal编程技术网

Linux 使用ab进行网站基准测试

Linux 使用ab进行网站基准测试,linux,performance,apache,benchmarking,Linux,Performance,Apache,Benchmarking,我正在为我正在开发的网站尝试各种基准测试工具,并发现apachebench(ab)是负载测试的优秀工具。这是一个命令行工具,显然非常容易使用。然而,我对它的两个基本标志表示怀疑。我读到的网站上说: Suppose we want to see how fast Yahoo can handle 100 requests, with a maximum of 10 requests running concurrently: ab -n 100 -c 10 http://www.yahoo.co

我正在为我正在开发的网站尝试各种基准测试工具,并发现
apachebench
(ab)是负载测试的优秀工具。这是一个命令行工具,显然非常容易使用。然而,我对它的两个基本标志表示怀疑。我读到的网站上说:

Suppose we want to see how fast Yahoo can handle 100 requests, with a maximum of 10 requests running concurrently:

ab -n 100 -c 10 http://www.yahoo.com/
对国旗的解释是:

Usage: ab [options] [http[s]://]hostname[:port]/path
Options are:
    -n requests     Number of requests to perform
    -c concurrency  Number of multiple requests to make
我想我只是无法理解执行请求的数量和多个请求的数量。当我像上面的例子一样将它们一起给出时会发生什么


有谁能给我一个更简单的解释这两个标志一起做什么吗?

在您的示例中,ab将创建10个到yahoo.com的连接,并同时使用每个连接请求一个页面

如果省略-C10ab,它将只创建一个连接,并且只在第一个连接完成时(当我们下载整个主页时)创建下一个连接

如果我们假设服务器的响应时间不依赖于它同时处理的请求数,那么您的示例将比不使用-C10时完成的速度快10倍


另外:

-n100-c10
表示“发出100个请求,每次10个。”