+5 votes
76 views
Monitor Linux Server Performance

in Linux/Unix by (552k points)
reopened | 76 views

1 Answer

+3 votes
Best answer

1 Monitor Linux server performance using Glances
2 Monitor Linux server performance using Top
3 Monitor Linux server performance using Htop

A Linux server offers the administrator multiple options when it comes to managing the processes and tasks that this type of system covers and something essential for everything to work as expected is the performance of the system and this in turn is linked to the performance of the equipment. where it is installed and two of the key components are the CPU and RAM. That is why it is interesting to know methods to be able to monitor Linux servers to know what is happening..

 

If any of these presents overload or instability, we will be facing a general impact on the server's performance and as administrators we will be able to supervise and monitor their values ​​in real time when we can even monitor Linux hard drives to see their behavior. It is for this reason that TechnoWikis will explain how to monitor the performance of a Linux server and as a bonus we will teach you those steps in a client system such as Ubuntu 22. We are going to see the importance and usefulness of monitoring a Linux server when we want to have information about Linux server performance in real time.

 

 

To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE

 

 


1 Monitor Linux server performance using Glances

 

Glances is an application written in Python that can be used on GNU/Linux, FreeBSD, OS X and Windows systems, this is a monitoring tool which seeks to generate a detailed report based on a graphical resource or on some systems using the Glances based interface. On the web, some of the information parameters used include:

 

  • CPU
  • RAM
  • disk I/O
  • IRQs
  • process list
  • network interfaces
  • Monitor
  • alerts
  • System information
  • Activity time
  • sensors
  • File system and folders
  • It is possible to export system statistics to CSV, InfluxDB, Cassandra, OpenTSDB, StatsD and more

 

Step 1

We install Glances on the server by running:
 sudo apt install glances 
image

 

Step 2

We enter the letter S to confirm the process:

 

image

 

Step 3

On the server we will see the following message indicating the processes that have to be restarted:

 

image

 

Step 4

We click OK to complete the process:

 

image

 

step 5

If we do this process in Ubuntu 22 we execute the command:
 sudo apt install glances 
image

 

step 6

We confirm the download and installation:

 

image

 

step 7

We hope it comes to an end:

 

image

 

step 8

For other editions of Linux we execute the following to install Glances:

 

  • sudo yum install glances (RHEL/CentOS/Fedora and Rocky/AlmaLinux)
  • sudo emerge -a sys-process/glances (Gentoo Linux)
  • sudo apk add glances (Alpine Linux)
  • sudo pacman -S glances (Arch Linux)
  • sudo zypper install glances (OpenSUSE)

 

step 9

On the server run:
 glances 
image

 

step 10

On the server we will see the following:

 

image

 

step 11

We see at the top a complete summary with details such as:

 

  • CPU model and version
  • Used percentage of RAM, CPU, and SWAP memory
  • Total CPU usage
  • Free and used memory
  • Loading time
  • network usage
  • Hard drive status

 

step 12

In the central part we find:

 

  • Number of tasks in real time
  • CPU and memory usage for each task
  • PID and user assigned to the task
  • Activity time
  • Command associated with the task

 

step 13

In the case of graphical Ubuntu we find the same details, only in a more organized way:

 

image

 

step 14

We can extend the terminal for a better perspective of the data:

 

image

 


2 Monitor Linux server performance using Top

 

Step 1

This command is very popular in Linux to access details of the performance of the system and its components, by default it is installed on the server and to use it we just execute "top":

 

image

 

Step 2

As a result we will see the following:

 

image

 

Step 3

At the top we will see details about:

 

  • Number of active, running and sleeping tasks
  • CPU, RAM and disk usage
  • Used and available RAM
  • System charging time
  • Number of connected users

 

Step 4

In the central part we will see:

 

  • PID and user of each process
  • virtual memory usage
  • RAM and CPU usage percentage
  • Process Priority (PR)
  • Shared memory size (kb) used by a task (SHR)
  • NI or task value
  • Activity time
  • command used

 

step 5

In the case of Ubuntu the result is similar:

 

image

 


3 Monitor Linux server performance using Htop

 

Step 1

Htop is an improved version of Top in terms of details and information, since it makes use of interactivity, we execute "htop" on the server (it is installed by default):

 

image

 

 

 

Step 2

The result will be the following:

 

image

 

 

Step 3

At the top we find details such as:

 

  • amount of tasks
  • System charging time
  • Hardware resource usage

 

Step 4

In the central part we find:
  • active PIDs
  • User assigned to the PID
  • Amount of virtual memory used
  • Usage, in percentage, of CPY and RAM
  • PID uptime
  • associated command

 

 

step 5

By pressing the F2 key it will be possible to access the configuration menu:

 

image

 

step 6

In the "Display" section it will be possible to activate (with the space bar) the visible results, with the Tab key we can navigate between menus.

 

In Header we define the number of columns to use:

 

image

 

step 7

In "Meters" we can define which criteria will go in each column:

 

image

 

step 8

In “Screens” we can see the main screen (Main) and the auxiliary screen (I/O) with each descriptor displayed there:

 

image

 

step 9

In "Colors" it will be possible to define the color to be displayed:

 

image

 

step 10

In the same way in Ubuntu 22 we can access all this information but there, on client computers, it will be necessary to install htop, for this we can use one of the following options:

 

  • sudo apt install htop (Ubuntu and Debian)
  • sudo yum install htop (RHEL/CentOS/Fedora and Rocky/AlmaLinux)

 

 

 

image

 

 

step 11

We execute htop to access the results:

 

image

 

step 12

As an extra point, it will be possible to know the uptime of our server with the "uptime" command:

 

image

 

step 13

To know the total number of processors we can execute:
 cat /proc/cpuinfo | grep processor 
image

 

step 14

To see the main running processes by CPU usage, we execute:

 

image

 

 

With these options that TechnoWikis has taught you, it will be possible to know the performance of the server and thus work directly on it..

 


by (3.5m points)
edited

Related questions

+3 votes
1 answer
asked Jun 12, 2023 in Linux/Unix by backtothefuture (552k points) | 66 views
+4 votes
1 answer
asked Apr 10, 2023 in Linux/Unix by backtothefuture (552k points) | 65 views
+5 votes
1 answer
asked Oct 18, 2022 in Linux/Unix by backtothefuture (552k points) | 77 views
+5 votes
1 answer
asked Oct 19, 2020 in Linux / Unix by backtothefuture (552k points) | 220 views
+3 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users