Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Monitoring system performance is crucial for ensuring that your Raspberry Pi operates efficiently and reliably. Whether you're using your Raspberry Pi for home automation, as a media server, or for educational purposes, keeping an eye on system metrics like CPU usage, memory consumption, and disk space can help you identify potential issues before they become critical. This article will guide you through the process of monitoring system performance on a Raspberry Pi using various tools and commands available in the Linux environment.
Examples:
Using top
Command:
The top
command provides a dynamic, real-time view of the system's processes. It displays system summary information as well as a list of tasks currently being managed by the Linux kernel.
top
To exit the top
interface, press q
.
Using htop
Command:
htop
is an interactive process viewer for Unix systems. It is a more user-friendly version of top
with a better visual representation of the processes.
Install htop
:
sudo apt-get update
sudo apt-get install htop
Run htop
:
htop
To exit the htop
interface, press F10
.
Using vmstat
Command:
The vmstat
command reports information about processes, memory, paging, block IO, traps, and CPU activity.
vmstat 5
This command will update the statistics every 5 seconds.
Using free
Command:
The free
command displays the amount of free and used memory in the system.
free -h
The -h
flag makes the output human-readable.
Using df
Command:
The df
command reports the amount of disk space used and available on file systems.
df -h
The -h
flag makes the output human-readable.
Using iostat
Command:
The iostat
command reports CPU and I/O statistics.
Install sysstat
package to get iostat
:
sudo apt-get install sysstat
Run iostat
:
iostat
Using sar
Command:
The sar
command collects, reports, or saves system activity information.
sudo apt-get install sysstat
sar -u 5 10
This command will report CPU utilization every 5 seconds, 10 times.