0

I have 60 websites in a Linux webserver (nginx) and i like to monitor how much time each website takes to full load. Something like tools.pingdom.com, where i put the URL and the locale and returns the time to full load the page. But i need this via Linux terminal, to automate this task for all websites and to new future websites. Someone knows any API or tool via Linux to do this job ? I tried wget and curl but the results are unstable, the wget i used:

(time wget -p --no-cache --delete-after example.com -q ) 2>&1 | awk '/real/ {print $2}'

But i cant set the locale and most of times the results are unstable, with the same websites resulting in 2 seconds to load and 10 seconds a few minutes ago.

Thanks !

vmbeliz
  • 51
  • 1
  • 3

1 Answers1

1

If the performance of your server is unstable, then, results are also unstable, but this is correct.

curl and wget are viable options for measuring the time it takes for a request. You can probably set the locale by setting the "Accept-Language" header to the value of the language you want (With wget --header and curl --header). Also, worth to note, curl has a -w flag that displays informations on stdout after a completed transfer, you can specify in the format of the -w args timings variables (e.g curl -w "First Byte: {time_starttransfer}, Total:{time_total}").

You can also have a look at the webpagestest tool. There's a hosted version with an api, and you can download the runnable version. It's cli, web and api, and it has supports for its internal scripting language that allows you to override headers. Webpagetest is totally different from curl and wget, because it loads the entire webpage (with all its assets, like css, js, images ...), and it measures the total time that a user will experience when browsing the website with a real browser. Under the hood, webpagetest drives real web browsers.

smaftoul
  • 2,375
  • 17
  • 14