We earn commission when you buy through affiliate links.
This does not influence our reviews or recommendations.Learn more.
Lets go through some of the most used Linux command-line utilities to diagnose performance-related issues.
The lsof utility can be convenient to use in some scenarios.
To list, all the files opened by a particular PID.
pidstat
pidstat can be used to monitor tasks managed by the Linux kernel.
Troubleshooting I/O related issues can be easy with this command.
The below example is to monitor every 5 seconds.
top
Probably one of the most used commands on Linux would be top.
The top command can be used to display system summary information and current utilization.
To display process details for specific user
To kill the process, you could execute the top and pressk.
It will prompt you to enter the PID to be killed.
ps
ps stands forprocess statusand widely used command to get a snapshot of the running process.
Very useful to find out if a process is running or not and if running then prints PID.
you might usetcpdumpto capture the data pipe packets on a data pipe interface.
iostat
iostat stands forinput-output statisticsand often used to diagnose a performance issue with storage devices.
you could monitor CPU, machine & online grid file system utilization report with iostat.
Thelddcommand can be handy to diagnose the app startup problem.
-gmeans to show the details in GB.
So as you’re free to see total available memory is 5 GB and 3 GB is free.
By just executingsarcommand will show you system utilization for the entire day.
By default, it stores utilization report in 10 minutes.
If you need something shorter in real-time, you’re able to use it as below.
It can be very handy to monitor the disk I/O latency in real-time.
Conclusion
I hope the above commands help in the various situation at your system administration job.
The above-mentioned commands are good to use on-demand.