Website speed, often called website performance, refers to the amount of time a web browser renders web pages from a specific site.
A site’s loading speed can significantly affect user experience (UX). For example, a slow website response time (SRT) can lead to high bounce rates. Subsequently, having a poorly performing website can harm your search engine optimization (SEO) efforts.
This article will cover three tips for testing a website’s speed, including how to do it in a Linux Terminal. By identifying the areas for improvement, website owners can optimize website speed more efficiently.
Why Checking Website Speed Is Important
Before we jump in to the tips, let’s review why checking website loading speed is necessary.
A slow loading time can drive visitors away. This is a significant disadvantage, especially for eCommerce websites, as it can impact conversion rates.
Ideally, a website should load between one to two seconds. Statistics also show that a website that loads within 1 second converts three times higher than sites loading in 5 seconds.
In addition, website loading speed is a crucial SEO ranking factor. Furthermore, Google has announced that excellent speed is vital not only for sites accessed from desktop computers but also from mobile devices.
Therefore, regularly monitoring and improving page speed should be every site owner’s priority.
How to Check Website Speed
Fortunately, checking website loading speed is easy. Site owners can utilize website performance tools to get a comprehensive analysis. Before we go into how to test your website on Linux, we’ll walk you through some website speed test tools for comparison.
1. Check with Google PageSpeed Insights
PageSpeed Insights (PSI) is a website speed test tool created by Google developers. For many years, it’s been the go-to tool for testing and grading website speed.
With PSI, website owners only need to enter their web page URL and press the Enter key or click the Analyze button to initiate the assessment.
Once the analysis is complete, PageSpeed Insights reports page performance on both desktops and mobile devices.
In the first section, web owners can review their core web vitals assessment. If the site’s overall load speed is good, a green Passed annotation will show. Furthermore, the Core Web Vitals Assessment section also contains information about:
- Largest contentful paint (LCP) – represents the amount of time a website needs to display its main content. An excellent LCP score is equal to or less than 2.5 seconds.
- First input delay (FID) – measures how long it takes for a visitor to get a response from a website from their first interaction. Website owners should aim for below 100 ms to ensure smooth performance.
- Cumulative layout shift (CLS) – quantifies how often visitors experience unexpected layout shifts. Anything less than 0.1 is considered a good CLS score.
- First contentful paint (FCP) – occurs when a web browser renders the first DOM element on a web page. For a better user experience, aim for an FCP of 1.8 seconds or less.
- Interaction to next paint (INP) – shows a web page’s overall interaction latency. In other words, INP assesses how fast a web page reacts to user interaction, like clicks and taps. An excellent INP score is below or at 200 ms.
- Time to first byte (TTFB) – is the measurement unit of website response time. Between 100 and 200 ms TTFB is considered excellent website performance.
Under the Core Web Vitals Assessment, website owners will find the Diagnose performance issues section. It’s divided into four subsections:
- Metrics – is where performance scores are presented. Above the table, users can also see their site’s overall score based on the Lighthouse scoring calculator.
- Opportunities – lists all suggestions that can help boost a website’s average speed.
- Diagnostics – provides further information on areas for improvement, which may directly impact page speed.
- Passed Audits – contains a list of all optimized metrics.
2. Use Website Performance Tools
Besides PageSpeed Insights, website owners can also use other website performance tools like Pingdom and GTmetrix. While these tools function similarly, they can offer different insights.
Let’s start with Pingdom.
Pingdom is easy to use and allows free configuration for several geolocation options. Here’s how to check a site’s performance with Pingdom Website Speed Test:
- Type in the website’s URL.
- Choose from the available geolocation choices.
- Click Start Test or press Enter.
Pingdom’s report page is clean and intuitive. On it, users can scan through data tables and identify areas for improvement with ease.
The report page contains:
- A quick overview of the site’s performance – includes the performance grade, page size, load speed, and number of requests.
- The Improve page performance section – contains grading and suggestions with an expandable menu for further information.
- The Response codes table – provides an overview of how a web server receives and processes requests.
- The Content size by content type and Requests by content type tables – enables website owners to see which web page elements use the most resources.
For a more comprehensive analysis, opt for GTmetrix. Here’s how to check site speed using this tool:
- Enter the site’s URL.
- Click Test your site or press Enter.
Note that geolocation options are only available for users with a GTmetrix account. If you want to configure that setting, be sure to register for an account.
On the report page, GTmetrix highlights the performance grade and core web vitals scores. Website owners can find the following information:
- Summary – contains speed visualization for several metrics, including website response time in TTFB, FCP, LCP, Onload Time, Time to Interactive, and Fully Loaded Time. This section also reveals the page’s top issues, size, and requests.
- Performance – is divided into two subsections. The Performance Metrics and Browsing Timings sections show the site’s core web vitals assessment.
- Structure – tells users how well their web pages are optimized.
3. Test Using the Linux Terminal
Linux Terminal is a text-based interface to process tasks on Linux computers. It’s often called the CLI (command-line interface.) Website owners can check their site’s speed in a Linux Terminal and review performance metrics related to website response time.
To conduct a page speed test, website owners should use the curl
command. Short for Client URL, the curl command lets users transfer data through different protocols.
Here’s how to check page speed in Linux Terminal:
Install curl in your system:
Use this command for Ubuntu/Debian
sudo apt install curl -y
And use this command for CentOS/Fedora:
sudo yum install curl -y
Once activated, run the following command: (change ADDRESS to either the site URL or its IP address):
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 ADDRESS
For HTTPS sites, use the following command line (change ADDRESS to either the site URL or its IP address):
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 ADDRESS
Once completed, you’ll see a set of information that the curl command-line tool generates:
- Lookup time – shows the amount of time for a user’s request to receive a response.
- Connect time – measures the time until the TCP connection to a remote server is complete.
- AppCon time – represents the time needed for an entire SSL communication process.
- Redirect time – records the total time for all redirection requests, including name lookup, connect, pre-transfer, and start-transfer times.
- Pre-transfer time – is the total time before file transfer starts.
- Start-transfer time – shows the amount of time before the first byte is transmitted to a remote server.
- Total time – refers to the time taken to complete a response.
Why Use the Linux Terminal
The Linux command line utilizes keywords in its terminal to perform a specific action. Most Linux CLI tools and apps come with the operating system installation (pre-installed). However, users will need to install some of them separately, including curl.
Learning how to use Linux for testing website speed is also pretty straightforward. Here are some advantages of conducting a site speed test on Linux:
- Time efficiency – all the tables, charts, and graphics that a website performance tool provides can take longer to load. On the other hand, the curl command-line tool can almost instantly return results.
- Control – with Linux command lines, users can decide which metric to check to get more tailored results.
- Availability – unlike website performance tools, which can experience errors, the Linux Terminal is available whenever needed.
- Flexibility – the Linux command line enables users to perform complicated or repetitive tasks that a website performance tool may not offer.
Conclusion on testing website speed on Linux
In this article, you’ve learned that it only takes a few curl commands to check the site speed in a Linux Terminal. You learned how to check website speed via online tools/websites on Linux. What’s more, using the Linux CLI offers many benefits, from time efficiency to control, availability, and flexibility.
Here’s a short recap for running a site speed test on Linux:
- Be sure to have curl installed on your system.
- Include the time_namelookup, time_connect, time_pretransfer, and time_starttransfer variables to the command.
- For HTTPS websites, don’t forget to insert the time_appconnect and time_redirect variables.
Good luck!