Questions tagged [top]
A command-line system monitor tool that produces a frequently-updated list of processes.
470
questions
0
votes
2
answers
31
views
How to get load averages and compulsory memory from a script?
uptime piped to sed fixes the first part but what about memory usage? top runs, at least by default, interactively.
So: I need to watch used RAM excluding opportunistic caching(which gets dropped as ...
1
vote
0
answers
44
views
ssh shell freezes with incomplete output after running top or tmux a
I'm sshing from my Mac into an Ubuntu Server 20.04 instance (using key-based authentication).
When I type any variety of commands, I get partial output, and then the shell becomes unresponsive to any ...
0
votes
0
answers
22
views
Use screen to tap into process using PID? [duplicate]
I have a command running, but I don't know how to gain access to it. I closed the terminal after starting it, but it's still running. If I stop it, much progress the command has made will be lost. I ...
3
votes
1
answer
190
views
Equivalent to "ps -p"
I'm using a board without the full ps command installed.
What I need is ps -p equivalent (something that sets $? if a specific PID is found or not).
Is there a way to accomplish this with another ...
0
votes
1
answer
29
views
Do 'finger' and 'pinky' always show all users currently logged in?
I've been playing around on my university's system and I noticed that sometimes the lists of logged in users I get from finger and pinky appear incomplete. For one thing, there were times when a ...
0
votes
2
answers
31
views
Find out which process is using CPU 0
I've applied CPUAffinity to certain systemd services. I've checked Cpus_allowed_list from /proc/PID/status, and it works fine.
Now I want to find out which process is using CPU 0 or CPU 1, how can I ...
0
votes
0
answers
103
views
how to scroll down cpu core's usage in top command
with top command, when press 1, cpu usage per core will be displayed. but when there are too many cores (like 256), only 50 can be fit into the screen, how to scroll to view usage of other cores?
I ...
0
votes
1
answer
228
views
How to make the top command calculate the CPU usage per second?
I am using top in Solaris mode via top -d 1 and it shows that one of my processes is using around 45% of CPU.
Question:
Since I'm using -d 1 does that mean that process is using around half of my ...
0
votes
0
answers
52
views
Different outputs in top or htop than podman stats
I have a Debian 11 server running Clickhouse Server in a Podman container. Recently I've been having problems with its system utilization hence I changed some configurations and set CPU and Memory ...
0
votes
0
answers
46
views
top batch output/width of command field
top truncates the command field to fit the width of the terminal line.
How can I maximise the width of that field for capture through a systemd-service? The assumption seems to be that the systemd ...
0
votes
1
answer
57
views
Why top is not reporting high %wa on too many write sys calls
My HTTP application suddenly started taking extra time to start up. During this phase, it loads the data from the disk to the in-memory data structure.
I doubt it is due to the extensive logging ...
0
votes
1
answer
65
views
how to check CPU usage at linux system startup?
I am stuck on finding a way to test CPU usage for a linux system at startup, usuing top or htop is too late for me to see the real usage at startup; is there an efficient way to it ?
1
vote
1
answer
98
views
Pass multiple rows from awk to xargs
I want an easy way to monitor the resource usage of processes matching certain keywords.
So I do something like:
ps -aux | grep XX | awk 'FNR == 2 {print $2}' | xargs -o -I {} top -p {}
(pgrep won't ...
1
vote
2
answers
56
views
Best way to get resource usage information for a process?
What would be the best way to go about monitoring resource usage of certain running processes? For example if I wanted to generate log files of CPU and memory usage over time.
From what I understand ...
2
votes
1
answer
152
views
How can I use htop or top to monitor CPUs' usage and output the infomation to a file?
I want to monitor the CPUs' usage when a program is running. I came out with the idea, that htop has the CPU usage information on the top. I wonder if I can somehow run htop, make it refresh every 0.1 ...
1
vote
0
answers
20
views
macOS: ps's columns "nswap nvcsw majflt minflt" are always empty, values are correct in top
Is there a system setting to enable reporting "nswap nvcsw majflt minflt" for ps on macOS? These fields are listed in the manual installed on macOS, but their column is always empty (shows -)...
0
votes
2
answers
79
views
How can I obtain a full tabular list of the running process on my system (with their command name and PID at least) for text processing consumption?
When I run top I see a screen similar to this,
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
654 root 20 0 25.5g 147780 70084 S 3.7 0.9 72:08.69 ...
2
votes
0
answers
85
views
python psutil vs top
I'm confused about the difference between CPU percentage as measured by the top command and by the psutil.cpu_percent
Here are two samples from the same second :
Python
>>> while pct := ...
0
votes
1
answer
341
views
how to open multiple new tabs in qterminal with a bash script in debian 11 lxqt
I am trying to create a bash script that will set up my all development stuff in an instant.
What I want the script to do: open 5 different tabs in one window.
clear terminal and start firefox-esr.
...
0
votes
1
answer
175
views
perf top not working as expected
I'm completely confused about the output of perf top
I'm running a C program called sac2, which burns an entire CPU. Specifically it iterates through a 100 billion byte array adding all the bytes as ...
1
vote
1
answer
5k
views
what is tracker-miner-f and how to stop it [duplicate]
I noticed lately that my computer heats up and the fans are louder than ever before and the battery life is shorter, so I rand top to see usage of cpu and ram and i noticed two process that consume ...
0
votes
2
answers
964
views
Explanation about free, available and buff/cache and how to find what process is buff/cache saved for in a server in the command "free -mh "
I see explanation for free -mh as:
free displays the total amount of free and used physical and swap
memory in the system, as well as the buffers and caches used by
the kernel. The information is ...
2
votes
0
answers
544
views
How can I hide all the idle processes in htop?
top hides all the idle processes with the -i flag. From man of the top:
PERFORMANCE/ACCURACY TRADEOFF
Calculating detailed memory statistics is fundamentally resource-intensive.
To reduce the ...
4
votes
2
answers
668
views
How can I determine which browser tab is the most network intensive?
top not only shows 'firefox' but also its individual tabs, each identified as 'Isolated Web Co'.
So it is possible to find which tab is hogging the processor and kill it with kill <PID>.
Is ...
0
votes
0
answers
33
views
AWS Ubuntu 20.04 memory 4G: not enough memory for running any app?
AWS E2 Ubuntu 20.04 memory 4G: not enough memory for running any app?
$ top
Tasks: 119 total, 1 running, 118 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, ...
1
vote
0
answers
175
views
load average calculation using top
I'm working on performance testing of application and would like to validate the performance of the server during testing. Currently, the server is a 16 multiprocessor with single core on each CPU.
I'...
0
votes
0
answers
666
views
High CPU utilization showing in CPU
We are running Two Node cluster using Redhat Pacemaker running on RHEL 7. Last thursday (3/2/2022) i updated kernel to latest version. And on Friday at 3:49 First node rebooted(Reason unknow) and ...
0
votes
1
answer
163
views
top command and + and * symbols
I am trying to fetch memory usage with below top command.
KiB Mem : 8009480 total, 1438848 free, 1964392 used, 4606240 buff/cache
KiB Swap: 7340028 total, 5302364 free, 2037664 used. 5202692 ...
0
votes
1
answer
86
views
Print values of %CPU over time for a particular process
The top command gives information on running processes. The %CPU column gives the percentage of CPU each process is using (CPU usage).
Is there a simple way to print values of %CPU over wall clock ...
21
votes
2
answers
2k
views
Why does 'top' fail to run via 'xargs'?
I am trying to run top with multiple PIDs using -p option and xargs. However, top fails to run with error top: failed tty get:
$ pgrep gvfs | paste -s -d ',' | xargs -t top -p
top -p 1598,1605,1623,...
0
votes
0
answers
31
views
Unexpected output of top when started by systemctl
Repost from StackOverflow because it belongs here:
I want to log the cpu and memory usage of a service which starts some time after startup (webappmgr.service). For this I have created another simple ...
0
votes
1
answer
550
views
top shows different pid for threads of same process. How to fix it?
when i do a ps -efT (where -T = Show threads, possibly with SPID column.), i see all the threads have the same PID, which is as expected.
myroot 24958 24958 7942 0 20:20 pts/12 00:00:00 java -...
0
votes
2
answers
700
views
Can I show process tree for 1 program?
I need to show all processes under a certain program. If I do top -p PID I will only get one program.
I want to type top -p 381 extra_args to get
PID USER PR NI VIRT RES %CPU %MEM ...
2
votes
1
answer
193
views
Linux CPU usage appears incorrect
I'm familiar with how the top is supposed to work. The individual processes are relative to 1 vcpu, and the summary is relative to all vcpus.
I have a process that does a lot of sleeping, and I'm ...
0
votes
2
answers
38
views
How is the information displayed by "top" ordered by default?
Been looking at top command as I'm new to Linux, but I can't see any correlations on how the displayed information is sorted. Can anyone sched any light on that?
1
vote
0
answers
263
views
Is there a program that will show me the average CPU usage over the last minute for every process?
One feature I miss from Windows is that the Resource Monitor program would show, among other statistics, the average CPU usage over the last minute for each program. On Linux I use either Gnome system ...
2
votes
0
answers
458
views
TOP says 90% CPU Idle, but processes showing 100% usage
I am experiencing a strange issue on my Linux machine. I am using 6 CPUs, 12 Hyper threads.
Top summary tab shows 90% idle. For 12 threads, 1200% should me the max usage. For 90% idle individual ...
0
votes
1
answer
139
views
Finding page faults using top command
Using top’s sorting capabilities in Linux, how to find the process that has generated the most page faults?
I have tried
top
then
f
then choose
nMaj
I then got a list of processes, but what sorting ...
1
vote
1
answer
87
views
TOP command combined with printf
I have a simple while true statement:
#!/bin/bash
while true; do
printf -- '-%.0s' {1..100}; echo "" | top -l 1 >> file.txt
sleep 10
done
The issue I am facing is that the ...
1
vote
1
answer
235
views
Why the value of PRI is different in ps and top?
nginx PID is 19910
The value is 19 in ps -eo pri
ps -eo pid,ppid,ni,pri,psr,pcpu,stat,cmd |head -n1;ps -eo pid,ppid,ni,pri,psr,pcpu,stat,cmd |grep nginx
PID PPID NI PRI PSR %CPU STAT CMD
19910 ...
2
votes
1
answer
2k
views
Show absolute memory usage for each process with `top`
By default, top will show, for each process, the fraction of physical memory used by that process:
top - 12:39:34 up 87 days, 18:25, 3 users, load average: 4.73, 4.89, 4.23
Tasks: 255 total, 2 ...
1
vote
1
answer
322
views
How do you get top to show wall clock time?
Is there a way to configure top to show wall clock time rather than CPU time? I'm sure CPU time is useful in some contexts, but in mine I want to know how long the process has been running since I ...
0
votes
0
answers
292
views
How am I able to check what triggered a process to run at a certain time?
I'm seeing a process popping up every 6h in one of my machines. I've checked the cron files and no user has anything that would trigger a cron job every 6h.
I'm trying to understand what is triggering ...
0
votes
1
answer
176
views
Script to display swap utilisation in top command
I need to write the script for displaying swap utilisation in top command, I am able to display top command but next shift+f needed to be included in script can you guys help me here
1
vote
1
answer
252
views
Is it possible to display NodeJS app path inside top command's output?
I'm trying to monitor system processes cpu & memory usage on a Ubuntu server with many running NodeJS applications.
top command only shows "node" without specifying which script is it.
...
0
votes
0
answers
61
views
How can I monitor whether disk activity is sychronous or asynchronous?
My Google-fu simply cannot find an answer to this.
If I have a process with heavy I/O activity, how can I check whether it's using asynchronous or synchronous writes?
(I want this information to ...
0
votes
1
answer
178
views
Track CPU load of a process
I have a process foo that I would like to run from the Terminal. At the same time, I'm interested in identifying how much this process is consuming the CPU, and so I want, for example, to go into top, ...
1
vote
1
answer
224
views
Take snapshot of top [duplicate]
I am trying to take a snapshot of top so that I can save it to a file. For example top -n 10 > top.txt. However top will of course continue to run, and I just want a snapshot. All the examples I ...
0
votes
1
answer
248
views
How to check my total memory, used memory and free memory from top command?
How to check my total memory, used memory and free memory according to this result?
free -m
total used free shared buff/cache
available
Mem: 128658 ...
0
votes
1
answer
67
views
in what situations will ni% in top is not 0
I learnt that ni represents the cpu used for userspace processes whose niceness or priority value is changed, but in my system, which is CentOS Linux release 7.9.2009 (Core), I did below test, all the ...