• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Thursday, May 8, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

How to Test Website Loading Speed in Linux Terminal

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
51
VIEWS
Share on FacebookShare on Twitter

A website response time can have a great impact on user experience, and if you are a web developer, or simply a server administrator who is particularly responsible for organizing the pieces together, then you have to make it a point that users don’t feel frustrated while accessing your site – so there is really “need for speed”.

Read Also: httpstat – A Curl Statistics Tool to Check Website Performance

This guide will show you how to test a website response time from the Linux command line. Here, we will show how to check the time in seconds, it takes:

  • to perform name resolution.
  • for TCP connection to the server.
  • for the file transfer to begin.
  • for the first byte to be transferred.
  • for the complete operation.

Additionally, for HTTPS-enabled sites, we will also see how to test the time, in seconds, it takes: for a redirect, and SSL connection/handshake to the server to be completed. It sounds good right, okay, let’s get started.

cURL is a powerful command line tool to transfer data from or to a server, using protocols such as FILE, FTP, FTPS, HTTP, HTTPS and many others. In most cases, it is used as a command line downloader, or for checking HTTP headers. However, here, we will describe one of its lesser-known functionalities.

cURL has a useful option: -w for printing information on stdout after a completed operation. It has some variables that we can use to test the different response times listed above, of a website.

We will use some of the time-related variables, which can be passed in a given format as a literal string or inside a file.

So open your terminal and run the command below:

$ curl -s -w 'Testing Website Response Time for :%{url_effective}/n/nLookup Time:/t/t%{time_namelookup}/nConnect Time:/t/t%{time_connect}/nPre-transfer Time:/t%{time_pretransfer}/nStart-transfer Time:/t%{time_starttransfer}/n/nTotal Time:/t/t%{time_total}/n' -o /dev/null http://www.google.com
How to Test Website Loading Speed in Linux Terminal

Test Website Loading Speed

The variables in the above format are:

  • time_namelookup – time, in seconds, it took from the start until the name resolving was completed.
  • time_connect – time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.
  • time_pretransfer – time, in seconds, it took from the start until the file transfer was just about to begin.
  • time_starttransfer – time, in seconds, it took from the start until the first byte was just about to be transferred.
  • time_total – total time, in seconds, that the full operation lasted (millisecond resolution).

If the format is too long, you can write it in a file and use the syntax below to read it:

$ curl -s -w "@format.txt" -o /dev/null http://www.google.com

In the above command, the flag:

  • -s – tells curl to work silently.
  • -w – print the information on stdout.
  • -o – used to redirect output (here we discard the output by redirecting it to /dev/null).

For HTTPS sites, you can run the command below:

$ curl -s -w 'Testing Website Response Time for :%{url_effective}/n/nLookup Time:/t/t%{time_namelookup}/nConnect Time:/t/t%{time_connect}/nAppCon Time:/t/t%{time_appconnect}/nRedirect Time:/t/t%{time_redirect}/nPre-transfer Time:/t%{time_pretransfer}/nStart-transfer Time:/t%{time_starttransfer}/n/nTotal Time:/t/t%{time_total}/n' -o /dev/null https://www.google.com
How to Test Website Loading Speed in Linux Terminal

Test HTTPS Website Speed

In the above format, the new time variables are:

  • time_appconnect – time, in seconds, it took from the start until the SSL connect/handshake to the remote host was completed.
  • time_redirect – time, in seconds, it took for all redirection steps including name lookup, connect, pretransfer and transfer before the final transaction was started; it computes the full execution time for multiple redirections.

Important points to be noted.

  • You will notice that the response time values keep on changing (due to several factors) as you run different tests, therefore it is advisable to collect several values and get an average speed.
  • Secondly, from the results of the commands above, you can see that accessing a website over HTTP is much faster than over HTTPS.

For more information, see the cURL man page:

$ man curl

Last but not least, if your results are not pleasing, then you have some adjustments to make on your server or within the code. You may consider using the following tutorials which explain programs and tips to make website(s) load faster in Linux:

  1. Install Nginx with Ngx_Pagespeed (Speed Optimization) on Debian and Ubuntu
  2. Speed Up Nginx Performance with Ngx_Pagespeed on CentOS 7
  3. Learn How to Speed Up Websites Using Nginx and Gzip Module
  4. How to Boost Linux Server Internet Speed with TCP BBR

That’s all! Now you know how to test website response time from the command line. You can ask questions via the feedback form below.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

5 Useful Tools to Remember Linux Commands Forever

Next Post

How to Use ‘Yum History’ to Find Out Installed or Removed Packages Info

Next Post

How to Use ‘Yum History’ to Find Out Installed or Removed Packages Info

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet