> For the complete documentation index, see [llms.txt](https://knowledge.tracelog.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.tracelog.in/linux-and-core/linux/show-processes-most-consuming-cpu-and-mem.md).

# Show processes most consuming CPU & MEM

### For CPU

```
$ ps -aux --sort=-pcpu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     30437  3.3  2.9 127052 60564 ?        S    Sep28 377:06 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170928064335Z backend-admin-deploy.yml
root     30440  3.3  2.6 194920 55220 ?        Sl   Sep28 377:06 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170928064335Z backend-admin-deploy.yml
root      2798  3.2  2.9 121952 59680 ?        S    Sep06 1401:46 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030038Z backend-admin-deploy.yml
root      2801  3.2  2.6 194916 55188 ?        Sl   Sep06 1415:24 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030038Z backend-admin-deploy.yml
root      2970  3.2  2.9 121952 59752 ?        S    Sep06 1409:28 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030350Z backend-admin-deploy.yml
root      2973  3.2  2.6 194916 55020 ?        Sl   Sep06 1416:16 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030350Z backend-admin-deploy.yml
root      3252  3.2  2.9 121952 59756 ?        S    Sep06 1408:45 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030604Z backend-admin-deploy.yml
root      3255  3.2  2.6 194916 54964 ?        Sl   Sep06 1413:53 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030604Z backend-admin-deploy.yml
root      3459  3.2  2.9 121952 59700 ?        S    Sep06 1412:12 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030817Z backend-admin-deploy.yml
root      3462  3.2  2.6 194916 55092 ?        Sl   Sep06 1410:22 /usr/bin/python /usr/bin/ansible-playbook -i hosts/web-qc -e ansistrano_release_version=20170906030817Z backend-admin-deploy.yml
jenkins  17319  0.1 26.9 2592812 552296 ?      Sl   Sep07  52:55 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080
root         1  0.0  0.2 121692  5820 ?        Ss   Jun22   0:35 /sbin/init
root         2  0.0  0.0      0     0 ?        S    Jun22   0:00 [kthreadd]
```

### For MEM

```
ps -aux --sort=+%mem | tail -n 10
```

### Reference: <https://www.pslinux.online/ps-aux.html>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledge.tracelog.in/linux-and-core/linux/show-processes-most-consuming-cpu-and-mem.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
