{"id":18367,"date":"2024-11-18T08:10:20","date_gmt":"2024-11-18T00:10:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18367\/"},"modified":"2024-11-18T08:10:20","modified_gmt":"2024-11-18T00:10:20","slug":"linux-%e6%9f%a5%e7%9c%8b%e8%bf%9b%e7%a8%8b%e8%bf%90%e8%a1%8c%e7%8a%b6%e6%80%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18367\/","title":{"rendered":"linux \u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001"},"content":{"rendered":"<blockquote><p>\n  \u5728 linux \u4e2d\u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\u53ef\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\uff1aps aux \u547d\u4ee4\u663e\u793a\u8fdb\u7a0b user\u3001pid\u3001cpu \u548c\u5185\u5b58\u5360\u7528\u7b49\u4fe1\u606f\u3002\u5e38\u89c1\u7684\u8fdb\u7a0b\u72b6\u6001\u5305\u62ec r\uff08\u8fd0\u884c\uff09\u3001s\uff08\u4f11\u7720\uff09\u3001d\uff08\u4e0d\u53ef\u4e2d\u65ad\u4f11\u7720\uff09\u3001z\uff08\u50f5\u6b7b\uff09\u548c t\uff08\u5df2\u505c\u6b62\uff09\u3002\u5176\u4ed6\u6709\u7528\u7684\u547d\u4ee4\u6709 top\uff08\u52a8\u6001\u663e\u793a\u8fdb\u7a0b\uff09\u3001htop\uff08\u4ea4\u4e92\u5f0f\u8fdb\u7a0b\u67e5\u770b\u5668\uff09\u548c pidstat\uff08\u663e\u793a cpu\u3001\u5185\u5b58\u548c i\/o \u7edf\u8ba1\u4fe1\u606f\uff09\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/17\/2024081718343116142.jpg\" class=\"aligncenter\" title=\"linux \u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\u63d2\u56fe\" alt=\"linux \u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\u63d2\u56fe\" \/><\/p>\n<p><strong>Linux \u4e2d\u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001<\/strong><\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\uff1f<\/strong><\/p>\n<p>\u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u8fdb\u7a0b\u7684\u8fd0\u884c\u72b6\u6001\uff1a<\/p>\n<pre>ps aux<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u547d\u4ee4\u8f93\u51fa\u89e3\u91ca<\/strong><\/p>\n<p>ps aux \u547d\u4ee4\u8f93\u51fa\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre>USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff0c\u5404\u5217\u8868\u793a\uff1a<\/p>\n<ul>\n<li> <strong>USER\uff1a<\/strong> \u8fdb\u7a0b\u6240\u5c5e\u7684\u7528\u6237<\/li>\n<li> <strong>PID\uff1a<\/strong> \u8fdb\u7a0b ID<\/li>\n<li> <strong>%CPU\uff1a<\/strong> \u8fdb\u7a0b\u5360\u7528\u7684 CPU \u767e\u5206\u6bd4<\/li>\n<li> <strong>%MEM\uff1a<\/strong> \u8fdb\u7a0b\u5360\u7528\u7684\u5185\u5b58\u767e\u5206\u6bd4<\/li>\n<li> <strong>VSZ\uff1a<\/strong> \u8fdb\u7a0b\u7684\u865a\u62df\u5185\u5b58\u5927\u5c0f<\/li>\n<li> <strong>RSS\uff1a<\/strong> \u8fdb\u7a0b\u7684\u5e38\u9a7b\u5185\u5b58\u5927\u5c0f<\/li>\n<li> <strong>TTY\uff1a<\/strong> \u8fdb\u7a0b\u542f\u52a8\u65f6\u6240\u5173\u8054\u7684\u7ec8\u7aef<\/li>\n<li> <strong>STAT\uff1a<\/strong> \u8fdb\u7a0b\u7684\u5f53\u524d\u72b6\u6001<\/li>\n<li> <strong>START\uff1a<\/strong> \u8fdb\u7a0b\u542f\u52a8\u7684\u65f6\u95f4<\/li>\n<li> <strong>TIME\uff1a<\/strong> \u8fdb\u7a0b\u8fd0\u884c\u7684\u65f6\u95f4<\/li>\n<li> <strong>COMMAND\uff1a<\/strong> \u8fdb\u7a0b\u7684\u547d\u4ee4\u884c<\/li>\n<\/ul>\n<p><strong>\u8fdb\u7a0b\u72b6\u6001<\/strong><\/p>\n<p><strong>\u5e38\u89c1\u7684\u8fdb\u7a0b\u72b6\u6001\u5305\u62ec\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>R\uff1a<\/strong> \u6b63\u5728\u8fd0\u884c<\/li>\n<li> <strong>S\uff1a<\/strong> \u4f11\u7720<\/li>\n<li> <strong>D\uff1a<\/strong> \u4e0d\u53ef\u4e2d\u65ad\u7684\u4f11\u7720<\/li>\n<li> <strong>Z\uff1a<\/strong> \u50f5\u6b7b\uff08\u5df2\u7ec8\u6b62\uff0c\u4f46\u7236\u8fdb\u7a0b\u5c1a\u672a\u56de\u6536\uff09<\/li>\n<li> <strong>T\uff1a<\/strong> \u5df2\u505c\u6b62<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u6709\u7528\u7684\u547d\u4ee4<\/strong><\/p>\n<p>\u9664\u4e86 ps aux \u547d\u4ee4\u4e4b\u5916\uff0c\u8fd8\u6709\u4e00\u4e9b\u5176\u4ed6\u6709\u7528\u7684\u547d\u4ee4\u53ef\u4ee5\u5e2e\u52a9\u67e5\u770b\u8fdb\u7a0b\u7684\u8fd0\u884c\u72b6\u6001\uff1a<\/p>\n<ul>\n<li> <strong>top\uff1a<\/strong> \u52a8\u6001\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u6d3b\u52a8\u7684\u8fdb\u7a0b<\/li>\n<li> <strong>htop\uff1a<\/strong> \u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7684\u8fdb\u7a0b\u67e5\u770b\u5668\uff0c\u63d0\u4f9b\u66f4\u9ad8\u7ea7\u7684\u529f\u80fd<\/li>\n<li> <strong>pidstat\uff1a<\/strong> \u663e\u793a\u8fdb\u7a0b\u7684 CPU\u3001\u5185\u5b58\u548c I\/O \u7edf\u8ba1\u4fe1\u606f<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f \u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 linux \u4e2d\u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\u53ef\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\uff1aps aux \u547d\u4ee4\u663e\u793a\u8fdb\u7a0b user\u3001pid\u3001cpu \u548c\u5185\u5b58\u5360\u7528\u7b49\u4fe1\u606f\u3002\u5e38\u89c1\u7684\u8fdb\u7a0b\u72b6\u6001\u5305\u62ec r\uff08\u8fd0\u884c\uff09\u3001s\uff08\u4f11\u7720\uff09\u3001d\uff08\u4e0d\u53ef\u4e2d\u65ad\u4f11\u7720\uff09\u3001z\uff08\u50f5\u6b7b\uff09\u548c t\uff08\u5df2\u505c\u6b62\uff09\u3002\u5176\u4ed6\u6709\u7528\u7684\u547d\u4ee4\u6709 top\uff08\u52a8\u6001\u663e\u793a\u8fdb\u7a0b\uff09\u3001htop\uff08\u4ea4\u4e92\u5f0f\u8fdb\u7a0b\u67e5\u770b\u5668\uff09\u548c pidstat\uff08\u663e\u793a cpu\u3001\u5185\u5b58\u548c i\/o \u7edf\u8ba1\u4fe1\u606f\uff09\u3002 Linux \u4e2d\u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001 \u5982\u4f55\u67e5\u770b\u8fdb\u7a0b\u8fd0\u884c\u72b6\u6001\uff1f \u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u8fdb\u7a0b\u7684\u8fd0\u884c\u72b6\u6001\uff1a ps aux \u767b\u5f55\u540e\u590d\u5236 \u547d\u4ee4\u8f93\u51fa\u89e3\u91ca ps aux \u547d\u4ee4\u8f93\u51fa\u683c\u5f0f\u5982\u4e0b\uff1a USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c\u5404\u5217\u8868\u793a\uff1a USER\uff1a \u8fdb\u7a0b\u6240\u5c5e\u7684\u7528\u6237 PID\uff1a \u8fdb\u7a0b ID %CPU\uff1a \u8fdb\u7a0b\u5360\u7528\u7684 CPU \u767e\u5206\u6bd4 %MEM\uff1a \u8fdb\u7a0b\u5360\u7528\u7684\u5185\u5b58\u767e\u5206\u6bd4 VSZ\uff1a \u8fdb\u7a0b\u7684\u865a\u62df\u5185\u5b58\u5927\u5c0f RSS\uff1a \u8fdb\u7a0b\u7684\u5e38\u9a7b\u5185\u5b58\u5927\u5c0f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-18367","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18367"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18367\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}