Use the Curl Command to view the request response time method
Curl Command to view the request response time
# curl -o /dev/null -s -w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download}"\n"https://www.php1.cn0.014::0.015::0.018::0.019::1516256.00
-O: write the html and js returned by curl to the spam recycle bin [/dev/null]
-S: remove all statuses
-W: write rt in the following format
Time_namelookup: the time when the DNS resolution domain name is www.php1.cn
Time_commect: the time when the client and server establish a TCP connection
Time_starttransfer: the time when the client sends a request to the web server to respond to the first byte
Time_total: the time when the client sends a request to the web server to send the corresponding data of the club.
Speed_download: the speed unit is byte/s next week.
The above command and returned results can be understood as follows:
0.014: the time unit for DNS resolution www.php1.cn is s.
0.015: the client sends a request to establish TCP time in c/s, which includes the DNS resolution time.
0.018: the time when the client sends a request, and the time when the first byte of the response is sent by s, including the previous two times.
0.019: the client sends a request, sends all the response data to the client in seconds, and closes the connect time.
1516256.00: data download speed
The time when TCP is established to connect to the server and the first byte of the client is returned: 0.018 s-0.015 s = 0.003 s
The time when the server sends the response data to the client: 0.019 s-0.018 = 0.01 s
The above is the content of the request response time method by using the Curl Command. For more information, see PHP Chinese network (www.php1.cn )!
Related articles:
Generate curl Command line in PHP on the server
Linux curl Command
Generate curl Command line in PHP on the server