Home >Backend Development >PHP Tutorial >Use Curl command to view request response time method
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: