How to check Internet Speed in linux server via Terminal

We have bought the server from UK and they are telling you are connected with 50 Mbps port. How i can check my internet speed (upload & download) in my server. For download speed we can use wget command and upload speed i advice and suggest you to try with lftp.

wget syntax:

Syntax :# wget [Option] [URL]

1) How to check download speed using wget.

Here i’m going to download the centos 6.5 iso image to check my server download speed.

[email protected] [/home/mageshm]# wget http://centos.excellmedia.net/6.5/isos/x86_64/CentOS-6.5-x86_64-LiveCD.iso
--2014-01-02 09:16:17--  http://centos.excellmedia.net/6.5/isos/x86_64/CentOS-6.5-x86_64-LiveCD.iso
Resolving centos.excellmedia.net... 202.153.32.16
Connecting to centos.excellmedia.net|202.153.32.16|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 680525824 (649M) [application/octet-stream]
Saving to: `CentOS-6.5-x86_64-LiveCD.iso'

100%[=============================================================================================================================>] 680,525,824 10.7M/s   in 73s

2014-01-02 09:17:30 (8.95 MB/s) - `CentOS-6.5-x86_64-LiveCD.iso' saved [680525824/680525824]

The above example clearly shows the server average download speed is 8.95 MB/s. You need to check 3 more times with different location and different file to confirm the speed.

2) How to check lftp installed in server ?

To check upload speed the better option is lftp. To check lftp package is installed or not in server click the link “How to Find out if package is installed in Linux“.

3) How to install lftp on RHEL / CentOS / Fedora.

You can use the following yum command to install lftp under RHEL / CentOS / Fedora distribution.

[email protected] [/home/mageshm]# yum install lftp
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.sov.uk.goscomb.net
 * extras: mirror.sov.uk.goscomb.net
 * updates: mirror.sov.uk.goscomb.net
base                                                                                                                                            | 3.7 kB     00:00
extras                                                                                                                                          | 3.4 kB     00:00
updates                                                                                                                                         | 3.4 kB     00:00
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package lftp.x86_64 0:4.0.9-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
 Package                              Arch                                   Version                                        Repository                            Size
=======================================================================================================================================================================
Installing:
 lftp                                 x86_64                                 4.0.9-1.el6                                    base                                 753 k

Transaction Summary
=======================================================================================================================================================================
Install       1 Package(s)

Total download size: 753 k
Installed size: 2.5 M
Is this ok [y/N]: y
Downloading Packages:
lftp-4.0.9-1.el6.x86_64.rpm                                                                                                                     | 753 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : lftp-4.0.9-1.el6.x86_64                                                                                                                             1/1
  Verifying  : lftp-4.0.9-1.el6.x86_64                                                                                                                             1/1

Installed:
  lftp.x86_64 0:4.0.9-1.el6

Complete!

lftp download syntax:

Syntax :# lftp -e ‘pget URL; exit; ‘

4) How to check download speed using lftp.

Here i’m going to download the centos 6.5 iso image to check my server download speed.

[email protected] [/home/mageshm]# lftp -e 'pget http://centos.excellmedia.net/6.5/isos/x86_64/CentOS-6.5-x86_64-LiveCD.iso; exit; '
`/6.5/isos/x86_64/CentOS-6.5-x86_64-LiveCD.iso', got 114782743 of 680525824 (16%) 8.88M/s eta:2m
oo...............................ooooooo..........................oooooo...........................oooooo...........................ooooooo...........................

Output:

The below output clearly shows the server average download speed is 9.71 MB/s. You need to check 3 more times with different location and different file to confirm the speed.

[email protected] [/home/mageshm]# lftp -e 'pget http://centos.excellmedia.net/6.5/isos/x86_64/CentOS-6.5-x86_64-LiveCD.iso; exit; '
680532375 bytes transferred in 67 seconds (9.71M/s)

5) How to check upload speed using lftp.

Here i’m going to upload the centos 6.5 iso image to our another server to check my server upload speed.

[email protected] [/home/mageshm]# lftp -u 2gadmin 83.170.117.116 -e 'put /home/mageshm/CentOS-6.5-x86_64-LiveCD.iso; bye'
Password: ******
`/home/mageshm/CentOS-6.5-x86_64-LiveCD.iso' at 214577672 (31%) 10.99M/s eta:40s [Sending data]

Output:

The below output clearly shows the server average download speed is 11.15 M/s. You need to check 3 more times with different location and different file to confirm the speed.

[email protected] [/home/mageshm]# lftp -u 2gadmin 83.170.117.116 -e 'put /home/mageshm/CentOS-6.5-x86_64-LiveCD.iso; bye'
Password: ******
680525824 bytes transferred in 58 seconds (11.15M/s)

6) How to upload file to particular path using lftp.

Here i’m going to upload the centos 6.5 iso image to our another server to check my server upload speed.

[email protected] [/home/mageshm]# lftp -u 2gadmin 83.170.117.116:/public_html -e 'put /home/mageshm/CentOS-6.5-x86_64-LiveCD.iso; bye'
Password: ******
cd ok, cwd=/public_html
`/home/mageshm/CentOS-6.5-x86_64-LiveCD.iso' at 131177216 (19%) 10.80M/s eta:49s [Sending data]

Output:

The below output clearly shows the server average download speed is 11.18M/s. You need to
check 3 more times with different location and different file to confirm the speed.

[email protected] [/home/mageshm]# lftp -u 2gadmin 83.170.117.116:/public_html -e 'put /home/mageshm/CentOS-6.5-x86_64-LiveCD.iso; bye'
Password: ******
cd ok, cwd=/public_html
680525824 bytes transferred in 58 seconds (11.18M/s)

Now, i’m going to check whether the file has been uploaded to destination server. See the output.

lftp [email protected]:/> ls
drwx--x--x   12 2gadmin   2gadmin         4096 Jan  2 12:05 .
drwx--x--x   12 2gadmin   2gadmin         4096 Jan  2 12:05 ..
-rw-r--r--    1 2gadmin   2gadmin           18 Feb 21  2013 .bash_logout
-rw-r--r--    1 2gadmin   2gadmin          176 Feb 21  2013 .bash_profile
-rw-r--r--    1 2gadmin   2gadmin          124 Feb 21  2013 .bashrc
-rw-------    1 2gadmin   2gadmin           23 Apr 29  2013 .contactemail
drwxr-xr-x    3 2gadmin   2gadmin         4096 Dec 12 13:31 .cpaddons
drwxr-xr-x    3 2gadmin   2gadmin         4096 Sep 26 07:02 .cpanel
drwxr-x---    2 2gadmin   99              4096 Apr 29  2013 .htpasswds
-rw-r--r--    1 2gadmin   2gadmin    680525824 Nov 29 17:09 CentOS-6.5-x86_64-LiveCD.iso
lrwxrwxrwx    1 2gadmin   2gadmin           34 Apr 29  2013 access-logs -> /usr/local/apache/domlogs/2gadmin
drwxr-xr-x    2 0          0              4096 Nov 28 10:01 backup
-rw-r-----    1 2gadmin   2gadmin            1 Sep 28 00:01 cpbackup-exclude.conf
drwxr-x---    2 2gadmin   12              4096 Apr 29  2013 etc
drwxr-x--x    8 2gadmin   2gadmin         4096 Dec 19 16:41 mail
drwxr-xr-x    3 2gadmin   2gadmin         4096 Apr 29  2013 public_ftp
drwxr-x---   14 2gadmin   99              4096 Jan  2 12:08 public_html
drwxr-xr-x    5 2gadmin   2gadmin         4096 Sep 28 00:01 ssl
drwxr-xr-x    7 2gadmin   2gadmin         4096 Apr 29  2013 tmp
lrwxrwxrwx    1 2gadmin   2gadmin           11 Apr 29  2013 www -> public_html

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...