Select Page

SQL on Linux: Exploring the System Utilities on Linux

JP Chen | | October 15, 2019

In Windows, we use the Task Manager to view the apps and processes and their CPU, Memory, Disk, and other utilizations details. We use Performance Monitor to view the live stats and performance of the system counters. What are the similar utilities for us do the same on Linux? While there are plentiful of tools you can use, we will explore 3 of the most popular ones: htop, glances, and iostat.

Using htop

Htop is an enhancement of another system monitoring tool called top. It allows you to monitor all processes running on the system. It is an interactive tool and allows you to kill a process, configure nice, sort columns, search for processes, and a lot more.

To use explore htop, perform the following steps:

1. Download and install htop if not already installed:
sudo apt-get update
sudo apt-get install htop

Key in your password when prompted.

2. Open htop:
htop


Figure 6-1: htop

3. Look at the upper left corner, you will see the CPU, Mem, and Swp details.

4. Look at the upper right corner, you will see the Tasks, Load average, and the system Uptime.

5. Click on the “CPU%” column to sort the processes by the percentage CPU time currently using.

6. Look at the bottom of the screen, you will see different functions and there F-keys to invoke them.

7. Press F10 to quit.

Using glances

Glances is a cross-platform system monitoring tool. Yes – you can run it on Linux and on Window. You can use glances to monitor CPU, load, memory, network rate, disk i/o, and file system. Glances shows 4 different types of colors for various statistics: Green – OK, Blue – attention, Violet – alert, Red – critical. You can adjust the thresholds by modifying the configure file located in /etc/glances/glances.conf.

To use explore glances, perform the following steps:

1. Download and install glances if not already installed:
sudo apt-get update
sudo apt-get install glances

Key in your password when prompted.

2. Open glances:
glances


Figure 6-2: glances

3. Press c to sort process by CPU.

4. Press m to sort process by MEM.

5. Press i to sort processes by I/O rate.

6. Notice that you can view the File System space usage in the “File SYS” section.

7. Press q to quit.

Using iostat

Iostat is a system monitor tool that can be used to collect and show operating system storage input and output statistics. It is often used to identify storage devices performance issues. The storage devices can be local disk or remote disks.

To use explore iostat, perform the following steps:

1. Download and install iostat if not already installed:
sudo apt-get update
sudo apt-get install sysstat

Key in your password when prompted.

2. Open iostat:
iostat


Figure 6-3: iostat

3. Notice that the first section contains the CPU report.

4. Look at the device utilization report in the second section. Tps is the number of transfers per second.

5. Convert the iostat to show report in megabytes unit:
iostat -m

6. Create a delay to view the trend:
iostat -m 5 3


Figure 6-4: iostat with MB unit, 5 seconds interval with 3 times reports

Subscribe to Our Blog

Never miss a post! Stay up to date with the latest database, application and analytics tips and news. Delivered in a handy bi-weekly update straight to your inbox. You can unsubscribe at any time.

12c Upgrade Bug with SQL Tuning Advisor

This blog post outlines steps to take on Oracle upgrade 11.2 to 12.1 if you’re having performance problems. Oracle offers a patch and work around to BUG 20540751.

Megan Elphingstone | March 22, 2017
sharepoint ideas

9 Awesome Things You Can Do with SharePoint

This blog post discusses out-of-the-box uses for SharePoint that you can execute in just a few clicks without using any code.

Amol Gharat | May 23, 2017

Best RAID For SQL Server | RAID 0, RAID 1, RAID 5, RAID 10

Which RAID should you use with SQL Server? Learn the differences between RAID 0, RAID 1, RAID 5, and RAID 10, along with best practices.

Eric Russo | June 8, 2015

Work with Us

Let’s have a conversation about what you need to succeed and how we can help get you there.

CONTACT US

Work for Us

Where do you want to take your career? Explore exciting opportunities to join our team.

EXPLORE JOBS