Knowledgebase: Support
Checking Internet Speed of the Server via Linux Command Line!
Posted by Susan Tyson on 20 July 2023 09:08 AM

Introduction:

Monitoring the internet speed of your server is crucial for maintaining optimal performance and ensuring a smooth user experience. Whether you're a system administrator or a website owner, Linux offers powerful command-line tools to assess your server's internet speed. In this article, we will explore how to check the internet speed of your server using Linux command-line tools, allowing you to identify potential bottlenecks and take appropriate actions to improve connectivity.

Step 1: Install Speedtest-cli:

Speedtest-cli is a simple and reliable command-line tool that measures the internet speed by connecting to Speedtest.net servers. To install it, open the terminal and run the following commands based on your package manager:

For Debian/Ubuntu:

sudo apt update
sudo apt install speedtest-cli

For CentOS/RHEL:

sudo yum install epel-release
sudo yum install speedtest-cli

Step 2: Test Internet Speed:

Once speedtest-cli is installed, you can check the internet speed by executing the following command in the terminal:

speedtest-cli

The tool will automatically choose the nearest Speedtest.net server, initiate a download and upload speed test, and display the results, including ping (latency), download speed, and upload speed.

Step 3: Specify the Server for Testing:

If you want to test your server's internet speed with a specific server, you can use the --server flag followed by the server ID. To list available servers, use:

speedtest-cli --list

Find the server ID from the list and run the speed test with the desired server:

speedtest-cli --server SERVER_ID

Step 4: Automate Speed Testing:

To regularly monitor your server's internet speed, you can create a simple bash script to automate the speed test at scheduled intervals. Here's an example of a basic script:

#!/bin/bash

LOG_FILE="/path/to/speedtest.log"
SPEEDTEST_CLI="/usr/bin/speedtest-cli"

echo "-----------------------" >> $LOG_FILE
date >> $LOG_FILE
$SPEEDTEST_CLI >> $LOG_FILE

Save the script to a file (e.g., speedtest.sh), make it executable (chmod +x speedtest.sh), and add it to your cron job to run it periodically.

Conclusion:

Using Linux command-line tools, you can easily check the internet speed of your server and monitor its performance over time. Regularly evaluating your server's internet speed helps you identify potential connectivity issues and take proactive measures to ensure a seamless experience for your users. By incorporating these simple tests into your server maintenance routine, you can maintain the efficiency and reliability of your online services.

 

 

 

 

Tag Words: Linux, Server, Internet Speed, Command Line, Network Monitoring, Server Performance, System Administration, Connectivity, Bandwidth Testing, Network Diagnostics.

(0 vote(s))
Helpful
Not helpful