{"id":257,"date":"2016-07-27T11:46:02","date_gmt":"2016-07-27T04:46:02","guid":{"rendered":"http:\/\/www.oopsbox.com\/?p=257"},"modified":"2016-07-27T11:46:25","modified_gmt":"2016-07-27T04:46:25","slug":"find-and-log-which-top-5-processes-are-taking-high-cpu","status":"publish","type":"post","link":"https:\/\/www.oopsbox.com\/?p=257","title":{"rendered":"Find and log which top 5 processes are taking high cpu"},"content":{"rendered":"<p>\u0e40\u0e27\u0e25\u0e32\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e15\u0e23\u0e30\u0e01\u0e39\u0e25 *nix \u0e1e\u0e1a\u0e1b\u0e31\u0e0d\u0e2b\u0e32 \u0e2d\u0e31\u0e19\u0e14\u0e31\u0e1a\u0e41\u0e23\u0e01 \u0e46 \u0e17\u0e35\u0e48\u0e08\u0e30\u0e40\u0e23\u0e34\u0e48\u0e21\u0e17\u0e33\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e41\u0e01\u0e49\u0e1b\u0e31\u0e0d\u0e2b\u0e32\u0e41\u0e25\u0e30\u0e0a\u0e48\u0e27\u0e22\u0e0a\u0e35\u0e27\u0e34\u0e15\u0e40\u0e23\u0e32\u0e01\u0e47\u0e04\u0e37\u0e2d\u0e40\u0e1b\u0e34\u0e14 Log \u0e40\u0e01\u0e34\u0e14\u0e1b\u0e31\u0e0d\u0e2b\u0e32\u0e1b\u0e38\u0e4a\u0e1a\u0e40\u0e1b\u0e34\u0e14 Log \u0e01\u0e48\u0e2d\u0e19\u0e40\u0e25\u0e22\u0e41\u0e15\u0e48\u0e1a\u0e32\u0e07\u0e01\u0e23\u0e13\u0e35\u0e40\u0e23\u0e32\u0e01\u0e47\u0e21\u0e2d\u0e19\u0e34\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e1c\u0e48\u0e32\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\/\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e37\u0e48\u0e19 \u0e42\u0e14\u0e22\u0e17\u0e31\u0e48\u0e27 \u0e46 \u0e44\u0e1b\u0e21\u0e31\u0e01\u0e08\u0e30\u0e43\u0e0a\u0e49 top \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e21\u0e2d\u0e19\u0e34\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e0b\u0e36\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e2a\u0e16\u0e32\u0e19\u0e30\u0e02\u0e2d\u0e07 Memory, CPU, Process <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-258\" src=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Terminal_042.jpg\" alt=\"Terminal_042\" width=\"658\" height=\"474\" srcset=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Terminal_042.jpg 658w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Terminal_042-300x216.jpg 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/p>\n<p>top \u0e19\u0e35\u0e48\u0e04\u0e37\u0e2d\u0e15\u0e49\u0e2d\u0e07\u0e21\u0e35\u0e40\u0e27\u0e25\u0e32\u0e19\u0e31\u0e48\u0e07\u0e14\u0e39\u0e40\u0e1e\u0e23\u0e32\u0e30\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e2d\u0e2d\u0e01\u0e21\u0e32\u0e41\u0e1a\u0e1a\u0e40\u0e23\u0e35\u0e22\u0e25\u0e44\u0e17\u0e21\u0e4c \u0e2d\u0e35\u0e01\u0e17\u0e32\u0e07\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e01\u0e47\u0e04\u0e37\u0e2d\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 <a href=\"http:\/\/linuxcommand.org\/man_pages\/ps1.html\">ps<\/a><\/p>\n<blockquote><p>ps &#8211; report a snapshot of the current processes.<\/p><\/blockquote>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\"> a@b \ue0b0 ~ \ue0b0 ps -aux                                   \ue0b2 1 \u21b5 \ue0b2 481 \ue0b2 11:31:05 \r\nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\r\nroot         1  0.0  0.0 185556  6264 ?        Ss   09:55   0:02 \/sbin\/init spla\r\nroot         2  0.0  0.0      0     0 ?        S    09:55   0:00 [kthreadd]\r\nroot         3  0.0  0.0      0     0 ?        S    09:55   0:00 [ksoftirqd\/0]\r\nroot         5  0.0  0.0      0     0 ?        S&lt;   09:55   0:00 [kworker\/0:0H]\r\nroot         7  0.0  0.0      0     0 ?        S    09:55   0:05 [rcu_sched]\r\nroot         8  0.0  0.0      0     0 ?        S    09:55   0:00 [rcu_bh]\r\nroot         9  0.0  0.0      0     0 ?        S    09:55   0:00 [migration\/0]\r\nroot        10  0.0  0.0      0     0 ?        S    09:55   0:00 [watchdog\/0]\r\nroot        11  0.0  0.0      0     0 ?        S    09:55   0:00 [watchdog\/1]\r\n<\/pre>\n<p>ps \u0e43\u0e0a\u0e49\u0e41\u0e25\u0e49\u0e27\u0e01\u0e47\u0e08\u0e1a\u0e44\u0e07 \u0e08\u0e30\u0e14\u0e39\u0e2d\u0e35\u0e01\u0e01\u0e47\u0e2a\u0e31\u0e48\u0e07\u0e2d\u0e35\u0e01 (\u0e43\u0e0a\u0e49 watch \u0e14\u0e39\u0e41\u0e1a\u0e1a top \u0e01\u0e47\u0e44\u0e14\u0e49\u0e19\u0e30 \u0e41\u0e15\u0e48\u0e08\u0e30\u0e43\u0e0a\u0e49 watch \u0e01\u0e47\u0e44\u0e1b\u0e43\u0e0a\u0e49 top \u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e01\u0e27\u0e48\u0e32\u0e40\u0e22\u0e2d\u0e30) \u0e41\u0e15\u0e48\u0e43\u0e19\u0e01\u0e23\u0e13\u0e35\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e01\u0e47\u0e1a Log \u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01 ps \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e39\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19 \u0e40\u0e0a\u0e48\u0e19\u0e2d\u0e32\u0e08\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e21\u0e2d\u0e19\u0e34\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e42\u0e1b\u0e23\u0e40\u0e2a\u0e2a\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e2a\u0e39\u0e07 \u0e46 \u0e2b\u0e23\u0e37\u0e2d\u0e21\u0e2d\u0e19\u0e34\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e14\u0e39\u0e20\u0e32\u0e22\u0e2b\u0e25\u0e31\u0e07\u0e27\u0e48\u0e32\u0e43\u0e04\u0e23\u0e01\u0e33\u0e25\u0e31\u0e07\u0e41\u0e2d\u0e1a\u0e41\u0e14\u0e01\u0e40\u0e21\u0e21\u0e21\u0e2b\u0e32\u0e42\u0e2b\u0e14 \u0e01\u0e47\u0e17\u0e33\u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49\u0e44\u0e14\u0e49<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">while true; do \r\n    ps auxf | sort -nrk 3,3 | head -n 5 &gt;&gt; log.log; \r\n    sleep 1; \r\ndone\r\n<\/pre>\n<p>\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">a@b \ue0b0 ~ \ue0b0 tail -f log.log                             \ue0b2 \u2713 \ue0b2 488 \ue0b2 11:40:13 \r\na        6019 28.6  4.0 2189732 663568 tty2   Sl+  09:57  28:48 \/usr\/lib\/firefox\/firefox\r\na        4376  4.7  1.2 2334564 198912 tty2   Sl+  09:57   4:49              \\_ \/usr\/bin\/gnome-shell\r\nroot      4222  2.7  0.4 534160 79804 tty2     Sl+  09:57   2:43          \\_ \/usr\/lib\/xorg\/Xorg vt2 -displayfd 3 -auth \/run\/user\/1000\/gdm\/Xauthority -background none -noreset -keeptty -verbose 3<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"s-share-buttons\" class=\"\"><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"fb-share-button\" data-href=\"https:\/\/www.oopsbox.com\/?p=257\" data-type=\"button_count\"><\/div><\/div><div class=\"s-single-share\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\"><\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/div><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"g-plusone\" data-size=\"medium\"><\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"\/\/www.pinterest.com\/pin\/create\/button\/\" data-pin-do=\"buttonBookmark\"  data-pin-color=\"red\"><img decoding=\"async\" src=\"\/\/assets.pinterest.com\/images\/pidgets\/pinit_fg_en_rect_red_20.png\" \/><\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<script type=\"text\/javascript\" async defer src=\"\/\/assets.pinterest.com\/js\/pinit.js\"><\/script>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/div><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"mailto:?Subject=Find%20and%20log%20which%20top%205%20processes%20are%20taking%20high%20cpu&Body=Here%20is%20the%20link%20to%20the%20article:%20https:\/\/www.oopsbox.com\/?p=257\" title=\"Email\" class=\"s3-email\"><img decoding=\"async\" src=\"https:\/\/www.oopsbox.com\/wp-content\/plugins\/simple-social-share\/includes\/..\/images\/share-email.png\"><\/a>\n\t\t\t\t\t\t\t\t\t\t\t<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>\u0e40\u0e27\u0e25\u0e32\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e15\u0e23\u0e30\u0e01\u0e39\u0e25 *nix \u0e1e\u0e1a\u0e1b\u0e31\u0e0d\u0e2b\u0e32 \u0e2d\u0e31\u0e19\u0e14\u0e31\u0e1a\u0e41\u0e23\u0e01 \u0e46 \u0e17\u0e35\u0e48\u0e08\u0e30\u0e40\u0e23\u0e34\u0e48\u0e21\u0e17\u0e33\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e41\u0e01\u0e49\u0e1b\u0e31\u0e0d\u0e2b\u0e32\u0e41\u0e25\u0e30\u0e0a\u0e48\u0e27\u0e22\u0e0a\u0e35\u0e27\u0e34\u0e15\u0e40\u0e23\u0e32\u0e01\u0e47\u0e04\u0e37\u0e2d\u0e40\u0e1b\u0e34\u0e14 Log \u0e40\u0e01\u0e34\u0e14\u0e1b\u0e31\u0e0d\u0e2b\u0e32\u0e1b\u0e38\u0e4a\u0e1a\u0e40\u0e1b\u0e34\u0e14 Log \u0e01\u0e48\u0e2d\u0e19\u0e40\u0e25\u0e22\u0e41\u0e15\u0e48\u0e1a\u0e32\u0e07\u0e01\u0e23\u0e13\u0e35\u0e40\u0e23\u0e32\u0e01\u0e47\u0e21\u0e2d\u0e19\u0e34\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e1c\u0e48\u0e32\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\/\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e37\u0e48\u0e19 \u0e42\u0e14\u0e22\u0e17\u0e31\u0e48\u0e27 \u0e46 \u0e44\u0e1b\u0e21\u0e31\u0e01\u0e08\u0e30\u0e43\u0e0a\u0e49 top \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e21\u0e2d\u0e19\u0e34\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e0b\u0e36\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e2a\u0e16\u0e32\u0e19\u0e30\u0e02\u0e2d\u0e07 Memory, CPU, Process <\/p>\n","protected":false},"author":1,"featured_media":259,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[31,10],"class_list":["post-257","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-ps","tag-shell-script","entry"],"views":2864,"_links":{"self":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257"}],"version-history":[{"count":2,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":261,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/257\/revisions\/261"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/media\/259"}],"wp:attachment":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}