x32x01

ADMINISTRATOR
test-website-loading-speed.png

In this post, we’ll cover two methods through which you can easily test your website loading speed and some other performance factors like Lookup Time, Connect Time, Pre-Transfer Time and Start-Transfer Time.

To start with first method, we’ll use CURL command which is one of the best tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.


For HTTP Websites – (View code)
Code:
curl -s -w ‘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



For HTTPS Websites – (View Code)
Code:
curl -s -w ‘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.yeahhub.com


As you can see that the above command syntax is too long and very difficult to remember, so you can also use the above method with an ease way in which you just need to create a “content.txt” file and embed the following content into it and save it.

Code: (View Code)
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


Now run the following command in your Linux terminal.
Code:
curl -s -w “@content.txt” -o /dev/null https://www.yeahhub.com


Curl also offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more.

The second method is with HTTPSTAT tool which is a single file Python script that has no dependency and is fully compatible with Python 3.

There are many ways to install this tool:
To use Httpstat, type “python httpstat.py https://www.yeahhub.com/


You can see in the above image an ASCII table displaying how long each process took, and for me the most important step is “server processing”.

With the help of Httpstat, you can easily test your website performance and optimize it according to your need.
 
Top