LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2019, 12:23 PM   #1
Manoj l
LQ Newbie
 
Registered: Oct 2018
Posts: 4

Rep: Reputation: Disabled
Unhappy Total CPU and RAM utilization


My server has 8 cores with 16GB RAM. I'm looking for command or tool which will provide output similar to windows Task Manager.

I found commands gtop, gotop for RAM, but for CPU usage it is segregated for each core. Is it possible to get a total CPU average.

Thanks for your time.
 
Old 02-12-2019, 12:33 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,094

Rep: Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365
That is interesting. I have never heard about that. But probably it is my own problem. And I have never needed that. You can simply calculate it using top (for example). Why do you need it at all?
 
Old 02-12-2019, 03:53 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,763

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
top, by default, displays aggregate usage of CPUs. I recently learned that by typing the number 1 while it's running would display usage for each CPU.

Of course, top is a command-line commmand. I don't have gtop, etc. Do have KSysGuard which also displays CPU independently.

So, top:
Code:
%Cpu(s):  7.1 us,  2.6 sy,  0.0 ni, 90.2 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
 
1 members found this post helpful.
Old 02-12-2019, 05:06 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,158

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Keep looking - I see a reference to vtop that seems to do the CPU as aggregated. Lots of other longer established options as well.
Given that they all likely get their data from /proc/stat (I haven't looked at any of the code), should be pretty easy to add/amend the code to suit.
The beauty of open source versus proprietary.
 
Old 02-14-2019, 03:47 PM   #5
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by Manoj l View Post
My server has 8 cores with 16GB RAM. I'm looking for command or tool which will provide output similar to windows Task Manager.

I found commands gtop, gotop for RAM, but for CPU usage it is segregated for each core. Is it possible to get a total CPU average.

Thanks for your time.
Windows task manager is a GUI interface. There are plenty of those in the GNU/Linux world. Ksysguard is one example mentioned, there are many others as well. Personally I prefer KDE widgets for the purpose. But that may not be appropriate for a server.

Question is. Do your server have a GUI? And which one?
 
Old 02-14-2019, 10:34 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
As above, if you want a gui, it depends a bit on which distro you have, but there are plenty of options.
Search your repos for '*system-monitor*' - prob first part of the name will inc the name of your desktop SW (in my case gnome or mate)
 
Old 02-15-2019, 02:51 AM   #7
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Rep: Reputation: Disabled
Quote:
Originally Posted by Manoj l View Post
My server has 8 cores with 16GB RAM. I'm looking for command or tool which will provide output similar to windows Task Manager.

I found commands gtop, gotop for RAM, but for CPU usage it is segregated for each core. Is it possible to get a total CPU average.
I have no idea how does Windows Task Manager work, but here are three options to consider for getting a total CPU average for a multicore system:

1. conky

Quote from its manpage:

Quote:
cpu (cpuN)
CPU usage in percents. For SMP machines, the CPU number can be
provided as an argument. ${cpu cpu0} is the total usage, and
${cpu cpuX} (X >= 1) are individual CPUs.
You will have to fiddle with its config a bit and either run conky in GUI mode so it paints on your desktop, or make it produce text output that you can pipe to another GUI tool

2. gkrellm

Perhaps not trendy anymore, but I've used it for many years and it served me well.

F1 to open settings, then Builtins -> CPU, and under the SMP Charts Select tick the Composite CPU checkbox. I believe you can even collect such kind of data on the server using gkrellmd and have it displayed on your remote workstation by grellm that connects to the server, if you need that.

3. htop

By default htop will show CPU load per core. After you run it for the first time, it creates a default config file in ~/.config/htop/htoprc

Open that file in a text editor and find the line

Code:
left_meters=AllCPUs Memory Swap
If you don't need the per-core load graphs, you can replace "AllCPUs" there with "CPU"

If you'd like to keep the per-core load graphs as well, but also want to see a total CPU average load, you could go with a setting like

Code:
left_meters=CPU AllCPUs Memory Swap
left_meter_modes=1 1 1 1
This way you will have an additional load bar displayed first on the left side, just above the per-core load bars.
 
1 members found this post helpful.
Old 02-19-2019, 05:28 AM   #8
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Not sure exactly what a "total CPU average" means..

But let's not forget to mention the "uptime" command in all of this. CLI.
Also worth mentioning is "powertop", it shows you some relevant info. CLI.

Last edited by zeebra; 02-19-2019 at 05:30 AM.
 
  


Reply

Tags
centos7, command line, gui



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get total cpu usage, total memory usage and available memory Chiba Linux - Software 1 11-15-2014 04:36 PM
High Run queue utilization although CPU utilization is low.. rajeprag Linux - Server 0 08-18-2013 09:44 AM
Total CPU utilization returned by "top" command sanpnair Linux - Newbie 1 05-15-2009 12:19 PM
Linux desktop GUI tool for CPU utilization and bandwidth utilization karimasif Linux - Software 4 03-03-2008 01:09 PM
getting total cpu utilization using c theog Programming 2 03-19-2005 04:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration