Find the most memory and CPU-efficient processes in Linux

Source: Internet
Author: User
Tags cpu usage

the following command looks at the list of top processes in descending order of RAM and CPU: [email protected]~]#PS-eo PID,PPID,CMD,%MEM,%CPU--Sort=-%mem |HeadPID PPID CMD%MEM%CPU1 0/sbin/init0.1 0.0 2 0[Kthreadd]0.0 0.0 3 2[migration/0]0.0 0.0 4 2[ksoftirqd/0]0.0 0.0 5 2[stopper/0]0.0 0.0 6 2[watchdog/0]0.0 0.0 7 2[events/0]0.0 0.0 8 2[events/0]0.0 0.0 9 2[events_long/0]0.0 0.0The parameters of the commands used above are briefly explained in the PSThe-O (or–format) option lets you specify the output format, and my favorite is to show the process of PIDs (PID), Ppids (PID), and the name of the execution file associated with the process (CMD), as well as the RAM and CPU usage (respectively:%mem and%CPU). Also, I usually use –SortTo sort%mem and%CPU. By default, the output is sorted in ascending order. But personally, I prefer to add a minus sign before the sort command to reverse the order. Add other fields to the output, or change the sorting criteria, refer to the Output Fromat CONTROL section of the PS Command's man page. The monitoring process is one of the digital tasks of the Linux server administrator, and in this little knowledge, we learned how to list processes in your system and sort them in descending order by RAM and CPU by using the PS tool. Reprint: Original: http://www.centoscn.cn/2661.html

Find the most memory and CPU-efficient processes in Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.