Tutorials

Test your Website Loading Speed with Curl and Httpstat in Kali Linux

In this article, 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)

Command: 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)

Command: 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.

Command: 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:

  • From Github:
    Command: git clone https://github.com/reorx/httpstat
  • With Wget:
    Command: wget https://raw.githubusercontent.com/reorx/httpstat/master/httpstat.py
  • Through pip:
    Command: pip install httpstat
  • Through Homebrew (Mac):
    Command: brew install httpstat
  • For Windows Version:
    Github Link – https://github.com/davecheney/httpstat

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.

Have something to say about this article? Comment below or share it with us on Facebook or Twitter.

H4ck0
Step by step hacking tutorials about wireless cracking, kali linux, metasploit, ethical hacking, seo tips and tricks, malware analysis and scanning.
https://www.yeahhub.com/

WHERE SHOULD WE SEND

HACKING TUTORIALS & INFOSEC NEWS?

Subscribe to Our Newsletter and Get Instant Delivered to Your Email Inbox.

We respect your privacy and take protecting it seriously.

Leave a Reply

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

two × 3 =