Investigate GNU/Linux box for io latency and network clogs

Yup as the title said I am gonna show you some measurement with some handly tools available for those actions.

I shall be running all those on a distribution called Arch Linux .

First I need to get few softwares which I need to manipulate. For that just open up a terminal and fire:

NB: In this distribution a binary is distributed to manage the packages in it..called “pacman”. Like we use in others distros i.e yum in Fedora; zypper in openSUSE,aptitude in Debian and emerge in Gentoo🙂 .

So here we go…

bhaskar@bhaskar-laptop_10:45:02_Wed Jul 28:~> sudo pacman -S iotop htop iptraf
warning: iotop-0.4.1-1 is up to date — reinstalling
warning: htop-0.8.3-1 is up to date — reinstalling
warning: iptraf-3.0.0-2 is up to date — reinstalling
resolving dependencies…
looking for inter-conflicts…

Targets (3): iotop-0.4.1-1 htop-0.8.3-1 iptraf-3.0.0-2

Total Download Size: 0.00 MB
Total Installed Size: 0.56 MB

Proceed with installation? [Y/n]

Here I select “N” ;because as you can see I have already loaded those software into my system.So lets start exploring those.

To get the IO bottleneck you need to use the software called iotop.Like this:

bhaskar@bhaskar-laptop_10:55:50_Wed Jul 28:~> sudo iotop -o -t
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 27.11 K/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
bhaskar@bhaskar-laptop_10:55:50_Wed Jul 28:~> sudo iotop -o -t
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND

Total DISK READ: 0.00 B/s | Total DISK WRITE: 42.65 K/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
10:55:56 993 be/4 root 0.00 B/s 38.77 K/s 0.00 % 0.04 % [kjournald]
10:55:56 4682 be/4 bhaskar 0.00 B/s 3.88 K/s 0.00 % 0.00 % firefox
10:55:56 4714 be/4 bhaskar 0.00 B/s 0.00 B/s 0.00 % 0.00 % plugin-container /usr/lib/mozilla/plugins/libflashplayer.so 3496 plugin
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
10:55:57 2857 be/4 http 0.00 B/s 3.87 K/s 0.00 % 0.00 % httpd -k start
10:55:57 4682 be/4 bhaskar 0.00 B/s 0.00 B/s 0.00 % 0.00 % firefox
Total DISK READ: 0.00 B/s | Total DISK WRITE: 15.49 K/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 46.47 K/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
10:56:01 993 be/4 root 0.00 B/s 11.62 K/s 0.00 % 0.04 % [kjournald]
10:56:01 4714 be/4 bhaskar 0.00 B/s 0.00 B/s 0.00 % 0.00 % plugin-container /usr/lib/mozilla/plugins/libflashplayer.so 3496 plugin
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
10:56:04 3373 be/4 bhaskar 0.00 B/s 7.76 K/s 0.00 % 0.00 % gnome-terminal
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
10:56:05 3373 be/4 bhaskar 0.00 B/s 3.88 K/s 0.00 % 0.00 % gnome-terminal

Ok.. I have used two options with that command.Now a bit more explanation of those.Option “-t” basically attached the time with the process. And “-o” only showing the actual IO happing there.For more option please visit the man page of it.I thought those two options are good enough to show the strength of it.

Now the second software we choose is htop..which is variant of top command ..but has more colorful thing in it.

lets fire it in a terminal:

htop

Click the picture to enlagre it.

Now if you want to make changes to it’s appearance and setup just press “F2” and it will put you in a mc like editor where you can modified the options you need.Look at the bottom of the window to press the correct option and use arrow key to move arround.If you run screen(as I always do) you can use mouse piinter too.

So next tool is called iptraf ..it is an ncurses based application to trac the network information about the connection.

iptraf:

Click the picture to enlarge.

So once again look at the bottom of window for the option.You can configure you network devices as you like and get the live stat flowing from it.So you get an clear idea what is going on.In that picture I have only select the ppp0(dialup) connection to show you the flow.

SS: the tcp/udp socket statistics dumper

Now to curious one most of the GNU/Linux distro come with a TCP/UDP stat dumper called ss.Please try it like this;

bhaskar@bhaskar-laptop_11:39:33_Wed Jul 28:~> sudo ss -a

for the security reason I am not posting the output of this command becuase it reveals lot of information.

Hope this will help .

Cheers!
Bhaskar

About unixbhaskar
GNU/Linux Consultant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: