{"id":1007,"date":"2017-01-16T10:13:43","date_gmt":"2017-01-16T10:13:43","guid":{"rendered":"http:\/\/linuxmotto.ir\/blog\/?p=1007"},"modified":"2017-01-16T10:13:43","modified_gmt":"2017-01-16T10:13:43","slug":"%d9%be%db%8c%d8%af%d8%a7-%da%a9%d8%b1%d8%af%d9%86-%d8%a7%d8%b3%da%a9%d8%b1%db%8c%d9%be%d8%aa-%d9%87%d8%a7%db%8c-cpu-%d8%a8%d8%b1-php","status":"publish","type":"post","link":"https:\/\/linuxmotto.io\/blog\/?p=1007","title":{"rendered":"\u067e\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0646 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0647\u0627\u06cc cpu \u0628\u0631 php"},"content":{"rendered":"<p>\u0627\u0645\u0631\u0648\u0632 \u06cc\u0647 \u0645\u0634\u06a9\u0644 \u0628\u0631\u062e\u0648\u0631\u062f\u0645. \u0648\u0628 \u0633\u0627\u06cc\u062a \u0628\u0647 \u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u0634\u062f\u0647 \u0628\u0648\u062f \u0648 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0647\u0627\u06cc \u0628\u0647 \u0631\u0648\u0632 \u0631\u0633\u0627\u0646\u06cc \u0634\u062f\u0647 \u062f\u0631\u062f\u0633\u0631 \u062f\u0631\u0633\u062a \u06a9\u0631\u062f\u0647 \u0628\u0648\u062f. \u0647\u0631 \u0627\u0632 \u06af\u0627\u0647\u06cc php \u0645\u06cc\u0632\u0627\u0646 \u0645\u0635\u0631\u0641 cpu \u0627\u0634 \u0645\u06cc\u0631\u0633\u06cc\u062f \u0628\u0647 100 \u062f\u0631\u0635\u062f\u060c \u0648\u0644\u06cc \u0646\u0645\u06cc \u062f\u0648\u0646\u0633\u062a\u06cc\u0645 \u06a9\u062f\u0648\u0645 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\u0647. \u0644\u0627\u0632\u0645 \u0628\u0648\u062f \u06a9\u0647 \u0633\u06cc\u0633\u062a\u0645 \u0631\u0627 \u06cc\u0647 \u0645\u062f\u062a \u06a9\u0648\u062a\u0627\u0647 \u0628\u0632\u0627\u0631\u0645 \u0632\u06cc\u0631 \u0645\u0627\u0646\u06cc\u062a\u0648\u0631 \u062a\u0627 \u0647\u0631 \u0645\u0648\u0642\u0639 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u0628\u06cc\u0634 \u0627\u0632 \u06f5\u06f0 \u062f\u0631\u0635\u062f cpu \u0631\u0627 \u0645\u0635\u0631\u0641 \u06a9\u0631\u062f\u060c \u0644\u0627\u06af \u0628\u06af\u06cc\u0631\u0647.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0647\u0645\u06cc\u0646 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0628\u0632\u0627\u0631\u06cc \u0628\u0631\u0627\u06cc \u0644\u0627\u06af \u06a9\u0631\u062f\u0646 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc php \u0648 \u0645\u06cc\u0632\u0627\u0646 \u0645\u0635\u0631\u0641 cpu \u0634\u0648\u0646 \u062f\u0627\u0634\u062a\u06cc\u0645. \u0634\u0627\u06cc\u062f \u0628\u067e\u0631\u0633\u06cc\u062f \u062e\u0648\u0628 \u06cc\u0647 top \u0628\u0627\u0632 \u06a9\u0646 \u0628\u0628\u06cc\u0646!<\/p>\n<p>\u06cc\u06a9\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0647\u0631 \u0627\u0632 \u06af\u0627\u0647\u06cc \u0627\u06cc\u0646 \u0627\u062a\u0641\u0627\u0642 \u0645\u06cc \u0627\u0641\u062a\u0627\u062f \u0648 \u062a\u0627 \u0645\u06cc \u0627\u0648\u0645\u062f \u0628\u0631\u0645 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u0645 \u0645\u0635\u0631\u0641 cpu \u0639\u0627\u062f\u06cc \u0645\u06cc \u0634\u062f \u0648 \u0646\u0645\u06cc \u062a\u0648\u0646\u0633\u062a\u0645 \u0628\u0641\u0647\u0645\u0645 \u0645\u0634\u06a9\u0644 \u06a9\u062c\u0627\u0633\u062a.<\/p>\n<p>\u0633\u0648\u0627\u0644: \u0628\u0647 \u0686\u0647 \u0634\u06a9\u0644 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc cpu \u0628\u0631 php \u06cc\u06a9 \u0648\u0628 \u0633\u0627\u06cc\u062a \u0631\u0627 \u067e\u06cc\u062f\u0627 \u06a9\u0646\u0645\u061f<\/p>\n<p>\u062c\u0648\u0627\u0628: \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0628\u0632\u0627\u0631\u06cc \u0622\u0645\u0627\u062f\u0647 \u0646\u06cc\u0633\u062a\u060c \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0628\u0632\u0627\u0631\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f bash \u0648 \u0686\u0646\u062f \u062a\u0627 \u062f\u0633\u062a\u0648\u0631 \u06a9\u0646\u0627\u0631 \u0647\u0645 \u0645\u06cc \u062a\u0648\u0646\u06cc\u062f \u0628\u0647 \u0634\u06a9\u0644 \u0632\u06cc\u0631 \u0628\u0647 \u0646\u062a\u06cc\u062c\u0647 \u0645\u0648\u0631\u062f \u0646\u0638\u0631\u062a\u0648\u0646 \u0628\u0631\u0633\u06cc\u062f:<\/p>\n<blockquote>\n<p dir=\"ltr\">while true; do ps faxuewwww -we | grep php | grep &#8211;color &#8220;^www-data&#8221; | tr -s &#8216; &#8216; | cut -f 1,3,10- -d &#8221; &#8220;| while read user cpu proc; do if [ &#8220;${cpu%.*}&#8221; -ge &#8220;50&#8221; ]; then echo &#8220;$cpu $proc&#8221; &gt;&gt; \/tmp\/php.log; fi ; \u00a0done; sleep 2 ; done<\/p>\n<\/blockquote>\n<p>\u0628\u0632\u0627\u0631\u06cc\u062f \u0627\u06cc\u0646 \u062f\u0633\u062a\u0648\u0631 \u06cc\u0647 \u0645\u062f\u062a \u06a9\u0627\u0631 \u06a9\u0646\u0647 \u0648 \u0628\u0639\u062f \u0641\u0627\u06cc\u0644 tmp\/php.log\/ \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f. \u062f\u0642\u062a \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0641\u0631\u0636 \u0628\u0631 \u0627\u06cc\u0646 \u0634\u062f\u0647 \u06a9\u0647 \u0648\u0628 \u0633\u0631\u0648\u0631 \u0634\u0645\u0627 \u062f\u0627\u0631\u0647 \u0628\u0627 \u06a9\u0627\u0631\u0628\u0631 www-data \u0627\u062c\u0631\u0627 \u0634\u062f\u0647 \u0627\u0633\u062a.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0627\u0645\u0631\u0648\u0632 \u06cc\u0647 \u0645\u0634\u06a9\u0644 \u0628\u0631\u062e\u0648\u0631\u062f\u0645. \u0648\u0628 \u0633\u0627\u06cc\u062a \u0628\u0647 \u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u0634\u062f\u0647 \u0628\u0648\u062f \u0648 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0647\u0627\u06cc \u0628\u0647 \u0631\u0648\u0632 \u0631\u0633\u0627\u0646\u06cc \u0634\u062f\u0647 \u062f\u0631\u062f\u0633\u0631 \u062f\u0631\u0633\u062a \u06a9\u0631\u062f\u0647 \u0628\u0648\u062f. \u0647\u0631 \u0627\u0632 \u06af\u0627\u0647\u06cc php \u0645\u06cc\u0632\u0627\u0646 \u0645\u0635\u0631\u0641 cpu \u0627\u0634 \u0645\u06cc\u0631\u0633\u06cc\u062f \u0628\u0647 100 \u062f\u0631\u0635\u062f\u060c \u0648\u0644\u06cc \u0646\u0645\u06cc \u062f\u0648\u0646\u0633\u062a\u06cc\u0645 \u06a9\u062f\u0648\u0645 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\u0647. \u0644\u0627\u0632\u0645 \u0628\u0648\u062f \u06a9\u0647 \u0633\u06cc\u0633\u062a\u0645 \u0631\u0627 \u06cc\u0647 \u0645\u062f\u062a \u06a9\u0648\u062a\u0627\u0647 \u0628\u0632\u0627\u0631\u0645 \u0632\u06cc\u0631 \u0645\u0627\u0646\u06cc\u062a\u0648\u0631 \u062a\u0627 \u0647\u0631 \u0645\u0648\u0642\u0639 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u0628\u06cc\u0634 \u0627\u0632 \u06f5\u06f0 \u062f\u0631\u0635\u062f cpu \u0631\u0627 \u0645\u0635\u0631\u0641 \u06a9\u0631\u062f\u060c \u0644\u0627\u06af \u0628\u06af\u06cc\u0631\u0647. \u0628\u0631\u0627\u06cc \u0647\u0645\u06cc\u0646 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0628\u0632\u0627\u0631\u06cc \u0628\u0631\u0627\u06cc \u0644\u0627\u06af \u06a9\u0631\u062f\u0646 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc php \u0648 \u0645\u06cc\u0632\u0627\u0646 \u0645\u0635\u0631\u0641 cpu \u0634\u0648\u0646 \u062f\u0627\u0634\u062a\u06cc\u0645. \u0634\u0627\u06cc\u062f \u0628\u067e\u0631\u0633\u06cc\u062f \u062e\u0648\u0628 \u06cc\u0647 top \u0628\u0627\u0632 \u06a9\u0646 \u0628\u0628\u06cc\u0646! \u06cc\u06a9\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0647\u0631 \u0627\u0632 \u06af\u0627\u0647\u06cc \u0627\u06cc\u0646 \u0627\u062a\u0641\u0627\u0642 \u0645\u06cc \u0627\u0641\u062a\u0627\u062f \u0648 \u062a\u0627 \u0645\u06cc \u0627\u0648\u0645\u062f \u0628\u0631\u0645 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u0645 \u0645\u0635\u0631\u0641 cpu \u0639\u0627\u062f\u06cc \u0645\u06cc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,17],"tags":[330,331,64,329],"class_list":["post-1007","post","type-post","status-publish","format-standard","hentry","category-administration","category-scripting","tag-cpu-consuming-php-script","tag-find-cpu-consuming-proccess","tag-script","tag-shell-script"],"_links":{"self":[{"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1007"}],"version-history":[{"count":1,"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1007\/revisions"}],"predecessor-version":[{"id":1008,"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1007\/revisions\/1008"}],"wp:attachment":[{"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxmotto.io\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}