Windows Resource Monitoring

In an IT support role, managing processes is essential, particularly when system processes become unstable or resource-heavy. Windows provides tools to monitor system resources, including Resource Monitor and Get-Process via PowerShell. Below is a breakdown of how these tools work.

๐Ÿ” Resource Monitor

Resource Monitor provides a graphical interface to observe system resources and manage processes. It offers five main tabs:

  1. Overview - Displays an overview of all system resources.

  2. CPU - Information about CPU usage by processes.

  3. Memory - Data on how processes utilize system memory.

  4. Disk - Monitoring of disk activity per process.

  5. Network - Details on network activity by processes.

Each tab shows processes and their resource consumption, such as CPU usage, memory (indicated by Private Bytes), and disk IO (input/output).

โš™๏ธ Command-Line Resource Monitoring

For users who prefer the command line, PowerShell offers the Get-Process command. This command retrieves detailed information about each running process, including non-paged memory (NPMK) in kilobytes (K). To further refine the information, users can filter processes using pipes (|) and sorting commands. Hereโ€™s an example of how to display the top 3 CPU-consuming processes:

Get-Process | Sort-Object CPU -Descending | Select-Object -First 3 -Property ID, ProcessName, CPU

๐Ÿ’ก Explanation of Command

  • Get-Process โ€“ Retrieves all running processes.

  • | Sort-Object CPU -Descending โ€“ Sorts processes by CPU usage in descending order.

  • | Select-Object -First 3 -Property ID, ProcessName, CPU โ€“ Displays only the top three processes based on CPU usage, showing their ID, name, and CPU consumption.

๐Ÿ“ˆ Process Explorer

In addition to Resource Monitor, Windows also offers Process Explorer to visualize process performance. By selecting a process and viewing its properties, users can see real-time performance graphs of:

  • CPU activity.

  • Memory usage (Private Bytes).

  • Disk IO activity.

๐Ÿง  Key Takeaways

  • Resource Monitor provides a graphical way to manage processes.

  • PowerShell's Get-Process allows command-line resource monitoring and filtering.

  • Process Explorer offers detailed performance insights for each process.

  • Effective process management helps troubleshoot performance issues and optimize resource use.


๐Ÿง Linux Resource Monitoring

In Linux, several commands allow you to monitor system utilization and manage processes effectively. Understanding and using these commands is crucial for troubleshooting performance issues. Below is a breakdown of key commands and how they help manage system resources.

๐Ÿ“Š top Command

The top command provides real-time monitoring of system resources. It displays the top processes consuming the most resources, offering insights into:

  • Total tasks: Running or idle.

  • CPU usage: Percentage of CPU resources being used.

  • Memory usage: Percentage of memory resources used by each task.

Key Fields:

  • %CPU: Shows the CPU usage of individual tasks.

  • %MEM: Shows the memory usage of individual tasks.

Usage Tip: Press q to exit the top command.

โš™๏ธ Common Scenario: High Resource Usage

When a computer is running slowly, itโ€™s often due to overuse of hardware resources. Use top to identify any tasks with high CPU or memory usage. If necessary, you can investigate or terminate these processes to free up resources.

โฒ๏ธ uptime Command

The uptime command provides essential system information, including:

  • Current time.

  • How long the system has been running.

  • Number of logged-in users.

  • System load averages: Displays CPU load over the past 1, 5, and 15 minutes.

This is useful for assessing system performance over time, especially when monitoring load fluctuations.

๐Ÿ“‚ lsof Command

The lsof (List Open Files) command helps track processes that are using files. For example, if you canโ€™t eject a USB drive because the system reports "device or resource busy," lsof can identify which processes are holding open files on the device.

lsof | grep /path/to/device

This command is highly effective for managing open files and resolving issues like blocked USB ejection.

๐Ÿ’ป Hardware Monitoring

If youโ€™re interested in monitoring CPU or memory usage independently of processes, Linux offers various commands for that purpose. These may not be critical for single-machine monitoring, but they become valuable when managing multiple machines or a fleet of systems.

๐Ÿง  Key Takeaways

  • The top command is invaluable for real-time process monitoring.

  • uptime provides load averages to track system performance over time.

  • Use lsof to troubleshoot open file issues, especially with removable drives.

  • Monitoring hardware separately from processes can be useful for system administrators managing many machines.

Last updated