Home  >  Article  >  Backend Development  >  Use Curl command to view request response time method

Use Curl command to view request response time method

高洛峰
高洛峰Original
2017-03-23 15:26:066011browse

Curl command to check the request response time

# curl -o /dev/null -s -w %{time_namelookup}::%
{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download}"\n"
http://www.php.cn
0.014::0.015::0.018::0.019::1516256.00

-o: Write the html and js returned by curl to the garbage collection bin [/dev/null]

-s: Remove all status

-w: Follow the following format Write rt

time_namelookup: The time when DNS resolves the domain name www.php.cn

time_commect: The time when the client and server establish a TCP connection

time_starttransfer: Make a request from the client; respond to the first byte of the web server Time

time_total: The client sends a request; the time it takes to send all the corresponding data to the web server

speed_download: Next week’s speed unit is byte/s

The above command and the return result can be understood like this:

0.014: The time unit for the DNS server to resolve www.php.cn is s

0.015: the time when the client issues a request and c/s establishes TCP; it includes the time of DNS resolution

0.018: when the client issues a request; when the first s response is issued The time when bytes start; including the previous 2 times

0.019: client sends a request; s sends all response data to the client; and closes the connect time

1516256.00: the speed of downloading data

Establishing a TCP connection The time for the server to return the first byte of the client: 0.018s – 0.015s = 0.003s

The time for the server to send the response data to the client: 0.019s – 0.018 = 0.01s

The above is to use the Curl command to check the request response time The content of the method, please pay attention to the PHP Chinese website (www.php.cn) for more related content!

Related articles:

Server-side PHP generates curl command line

Linux system curl command

Server-side PHP generates curl command line

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn