Performance monitoring on Linux

Hi everyone, i want to examine Performance monitoring on Linux. However this is a Sysadmin’s subject, but necessary for DBA’s.

Each DBA is responsible for the operating system on which the database is running. The slow operation of your database may be due to the operating system. So we have to know source problems.

In this article we will look at the commands and tools that we can monitor performance on our Linux operating system.

 

1. Top Command :

The top command updates the data on the screen at two-second intervals, is a tool that shows the amount of CPU load, the amount of memory and CPU used by the processes.

top

The sample result is as follows ,

The output of the top command has two important parts. In the first part, we can find information about processor(CPU) average load, processor status, memory usage status and swap space usage information.

The average load amount is the average number of queued operations in the processor within 1.5.15 minutes.

The processor status section shows the level of use of the processors in the system. The workload of user “oracle” in the operating system is displayed as user time (Cpu(s): 0.8%us

If we want to elaborate the top command, we can give various parameters.

Only with the u parameter we specify which operating system user to monitor.

You can use ctrl + c to exit.

 

Ps Command :

It’s a very common command to monitor running processes. Shows the list of processes running in the current session when run without parameters.
The following usage lists all process,
ps -ef
For a specific process, the output is “|” Customize using pipe.
Let’s see the detail of SMON background process
ps -ef | grep SMON

Sar and kSar Tool :

Sar (System Activity Reporter ) is a tool that reports system activity. Works with system activity data collector (sadc).

The data collected with sar can be written to files and long-term reports can be created. With the installation of the sysstat rpm package, sadc periodically writes the sa1 script to the cron.

 

By default, this script runs at 10-minute intervals and collects all system statistics at 1-second intervals.  The collected data is added to the files in the / var / log / sa directory. The Sa2 script runs once a day and reports the data collected by sadc the previous day.

sar 2 2

The first parameter shows the time interval, the second parameter shows the number of samplesThe most preferred method is to write the data collected with the -o parameter to a file. Data written to the file cannot be read with the text editor(vi, gedit.). Created file in binary format.

sar -A -o dbexample.sa 2 200

The above file collects all statistical data 200 times at 2 second intervals and saves it to the file named dbexample.sa

Ksar is a tool that graphically presents the files created with sar or the output of the sar command. kSar tool is not available by default on linux

Let’s try together,

Dowload kSar https://sourceforge.net/projects/ksar/files/latest/download 

Extract zip on your location

 

Double-click the kSar.jar file

 

To get our data from the operating system, we need to connect with ssh

Write username ad correct ip adress

Run sar script to collect all data.

Finally, you can select the area you want to display on the left. It is also possible to produce results in PDF format

 

In this article we reviewed two performance monitoring tools. Many different samples are available. See you next article.

 

 

 

 

 

Deniz Parlak

Hi, I'm a Computer Engineering student in Dumlupınar University.I will graduate next year. I did an internship TurkNet Telecominication Company in 2018 June- 2018 September. I had experience Linux/Unix system, SQL Server Management , SSRS, Mysql Database Management,Troubleshooting performance issues in Linux. I also interested Oracle database and technologies. I want to work as Oracle DBA after my University. I am practicing Unix, Exadata, Orace Cloud, Oracle RAC, Dataguard, EBS, Oracle BI and etc and i hope the articles will be helpful. Any questions, or support please write email deniz.parlak@yahoo.com

One thought on “Performance monitoring on Linux

Leave a Reply

Your email address will not be published. Required fields are marked *