How to troubleshoot HTTP request performance with curl statistics

Table of Contents


When troubleshooting a performance issue with a web-based endpoint, it's important to have metrics that assist in understanding what areas are related.

This is where using a lightweight tool like curl, and it's ability to write out the statistics of a request can be very useful.


You will just need curl installed and available from the location performing the test.


Download the format file to use with curl:

curl -OLs

You should now have a curl-format.txt file locally in the current directory.

Using the file and the -w flag, perform the desired request to the service, the example below displays the headers and statistics.

curl -I -w "@curl-format.txt"

Timing statistics will be output with each run of the command, measurements are recorded in seconds.

Note: run the command from a location that provides an accurate reproduction of the issue, to simulate the issue as closely as possible. Using the same request parameters are important - like the path and headers that might be used by client applications.

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.