InterspaceBaza znanjaTehnični člankiUčenjeNapredno spremljanje Linux sistema z Glances
UČENJE
11-Dec-202001-Feb-2023
Napredno spremljanje Linux sistema z Glances
Ta vsebina je na voljo samo v angleščini.
Glances stands out as an all-encompassing monitoring tool, offering a snapshot of vital system metrics in real-time. Compatible with a broad range of Linux distributions, including both Debian and Red Hat-based systems, Glances delivers in-depth visibility into CPU, memory, disk I/O, and network statistics, among others.

1.Installation

1.1.Debian-based Systems

Glances is easily installed on Debian-based systems like Ubuntu or Debian. Use the APT package manager to handle the installation and manage all necessary dependencies.
sudo apt update && sudo apt install glances

1.2.Red Hat-based Systems

Installing Glances on Fedora, CentOS, and other Red Hat-related distributions typically involves using the DNF package manager, as CentOS 8 and Fedora have moved to DNF for package management. However, for CentOS 7 and earlier versions, YUM is still in use.

To ensure compatibility and access to Glances on CentOS 8, you might need to enable the EPEL (Extra Packages for Enterprise Linux) repository first, as Glances may not be available in the default repositories.
For CentOS 8 and Fedora (using DNF)

First, enable the EPEL repository to access additional packages: sudo dnf install epel-release

Then, install Glances: sudo dnf install glances
For CentOS 7 and earlier versions (using YUM)

On CentOS 7, the EPEL repository can also provide access to Glances. Enable EPEL and install Glances as follows: sudo yum install epel-release

Followed by: sudo yum install glances -y

2.Launching Glances

Starting Glances is straightforward with the following single command.
glances

This opens the Glances interface, offering a real-time overview of your system’s health and performance.

3.Monitoring System Resources

3.1.CPU Usage

Glances offers detailed insights into CPU usage, clarifying how resources are distributed among processes. This information is crucial for maintaining optimal system performance. Tips:

  • Encountering high CPU usage can slow down your system. Use Glances to identify the top CPU-consuming processes. Once identified, consider optimizing the process’s code for efficiency or offloading some tasks to less busy times to prevent bottlenecks.
  • Regular monitoring with Glances can help establish a baseline for normal CPU usage. When usage deviates significantly from this baseline, investigate background services or scheduled tasks that could be causing spikes. Adjusting their priorities or scheduling might mitigate the impact on critical operations.

3.2.Memory and Swap Utilization

Glances provides essential information on memory and swap usage, highlighting when resources are stretched thin. Tips:

  • If Glances shows your system frequently uses swap, this might indicate your RAM is insufficient for your workload. Before adding more RAM, review running applications to identify any that are using more memory than expected. Sometimes, configuring memory usage limits for certain applications can alleviate the need for immediate hardware upgrades.
  • Analyzing swap usage trends with Glances can guide effective memory management strategies. For example, if swap usage peaks during specific operations, you might need to schedule these operations during off-peak hours or optimize them to reduce their memory footprint.

3.3.Disk I/O Performance

Monitoring disk I/O with Glances helps identify storage performance issues, crucial for applications that rely heavily on disk access. Tips:

  • Persistent high disk usage signals it's time to investigate. Start by using Glances to identify which processes are writing to or reading from the disk most frequently. You may discover logging verbosity can be reduced, or that it's time to partition data across multiple storage solutions to distribute the load more evenly.
  • Glances can point to abnormal disk activity patterns. If you notice sudden changes in disk activity that don't align with expected usage, consider checking for unnecessary file operations or optimizing database queries to reduce disk strain.

3.4.Network Throughput

Glances keeps an eye on network throughput, a vital aspect for troubleshooting network issues and ensuring adequate bandwidth. Tips:

  • An unexpected increase in network traffic might indicate a problem. Use Glances to drill down into per-application network usage. This can help identify if a specific service is consuming too much bandwidth, possibly due to a misconfiguration or an ongoing attack, such as a DDoS. Implementing rate limiting on the application or using network traffic management tools can mitigate the issue.
  • After making network configuration changes, use Glances to observe the effects in real-time. This immediate feedback can be invaluable for adjusting settings to achieve desired throughput levels, ensuring your network can handle both everyday tasks and peak loads efficiently.

4.Web Mode

Glances can easily be accessed remotely in web mode, simply by running the command:
glances -w

To access your system's monitoring dashboard open http://your_server_ip:61208 in a web browser.

Remote monitoring via web mode is particularly useful for teams. It simplifies sharing system health data and accelerates collaborative troubleshooting.

For secure access, especially over the internet, consider using an SSH tunnel or a VPN to connect to the Glances web interface.
Vsebina tega dokumenta je licencirana s strani Interspace pod MIT licenco

Povezana vsebina
Dokumentacija
Oblak
Komunikacije
Gostovanje
My Interspace
Tehnični članki
Vodniki
Učenje
Novice
Zadnje novice
Zadnji dogodki
Povezani produkti
Elastični oblačni VPS
Elastični oblačni VPS je virtualni stroj, ki ga poganjajo napredne oblačne in omrežne tehnologije, ki ponuja pomembne prednosti pred tradicionalnim VPS gostovanjem po nepremagljivem razmerju med ceno in zmogljivostjo. Namestite OS in aplikacije v samo 1 minuti. Dinamično dodajajte ali odstranjujte funkcije. Samodejne varnostne kopije z enim klikom, posnetki in replikacija za obnovo po nesreči, shranjeni v oddaljenem podatkovnem centru na varni razdalji. Nova generacija AMD EPYC procesorjev, izjemno hitri NVMe diski, namenske povezave in brezplačno zasebno omrežje.
Premium internetni dostop
Internetni dostop najvišjega razreda za profesionalne potrebe. Vrhunska točka-točka optična povezava, simetrična hitrost prenosa navzdol/navzgor, neomejen promet, SLA 99,9% in statični IP. Neposredne povezave do najboljših globalnih ponudnikov prve stopnje. Naša omrežna arhitektura je skrbno zasnovana za zagotavljanje najvišje kakovosti povezav do katerekoli destinacije po svetu, s hitrostmi prenosa brez primere in večnivojsko redundanco.
Namenski strežniki
Namenski strežniki na vrhunski strojni opremi priznanih proizvajalcev strežnikov. Gostujejo v naših podatkovnih centrih, kar nam omogoča popoln nadzor pri zagotavljanju delovanja 24/7. Izbira primarnih podatkovnih centrov in podatkovnega centra za obnovo po nesreči, ki se nahaja na varni razdalji. Možnosti nadzora napajanja (ponovni zagon, izklop/vklop) in brezplačen KVM-over-IP na voljo 24/7 z enim klikom, vključno s podporo za oddaljeni zagon/namestitev lastnih ISO datotek.


Naša spletna stran uporablja piškotke. Z nadaljnjo uporabo naše spletne strani soglašate z uporabo piškotkov in se strinjate z našimi Pogoji uporabe. Razumem