top
To check cpu and memory usage of active jobs on a server use the command 'top':
top
To only see only jobs of a specific user you can call it with:
top -u username
Alternatively, you can also press 'u' once top is open. In the 6st line you will then see :
Which user (blank for all)
Then you can just start typing or copy-pasting the username.
By default, 'top' sorts all jobs by cpu usage. To sort them by memory usage just type 'M' (capital 'm') once 'top' is open.
To quit 'top' just press 'q'.
Output explanation
The column headings in the process list are as follows (most important ones are in red):
- PID: Process ID.
- USER: The owner of the process.
- PR: Process priority.
- NI: The nice value of the process.
- VIRT: Amount of virtual memory used by the process. On our servers, currently, the maximum virtual memory a job can use is 25% of the total memory. Which means 64 GB on most of our servers.
- RES: Amount of resident memory used by the process. This is the actual memory your process is using!!!
- SHR: Amount of shared memory used by the process.
- S: Status of the process. (See the list below for the values this field can take).
- %CPU: The share of CPU time used by the process since the last update. Can go up to a little more than 100%.
- %MEM: The share of physical memory used.
- TIME+: Total CPU time used by the task in hundredths of a second.
- COMMAND: The command name or command line (name + options).
The following is from:
https://www.howtogeek.com/668986/how-to-use-the-linux-top-command-and-understand-its-output/
The first line of numbers on the dashboard includes the time, how long your computer has been running, the number of people logged in, and what the load average has been for the past one, five, and 15 minutes. The second line shows the number of tasks and their states: running, stopped, sleeping, or zombie.
The third line displays the following CPU values:
- us: Amount of time the CPU spends executing processes for people in “user space.”
- sy: Amount of time spent running system “kernel space” processes.
- ni: Amount of time spent executing processes with a manually set nice value.
- id: Amount of CPU idle time.
- wa: Amount of time the CPU spends waiting for I/O to complete.
- hi: Amount of time spent servicing hardware interrupts.
- si: Amount of time spent servicing software interrupts.
- st: Amount of time lost due to running virtual machines (“steal time”).
The fourth line shows the total amount of physical memory, and how much is free, used, and buffered or cached.
The fifth line shows the total amount (also in kibibytes) of swap memory, and how much is free, used, and available. The latter includes memory that’s expected to be recoverable from caches.
The status of the process can be one of the following:
- D: Uninterruptible sleep
- R: Running
- S: Sleeping
- T: Traced (stopped)
- Z: Zombie