{"id":2431,"date":"2023-06-29T10:40:26","date_gmt":"2023-06-29T02:40:26","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=2431"},"modified":"2023-06-29T10:40:26","modified_gmt":"2023-06-29T02:40:26","slug":"%e7%97%85%e6%af%92%e7%9a%84%e6%9f%a5%e6%9d%80%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/uncategorized\/%e7%97%85%e6%af%92%e7%9a%84%e6%9f%a5%e6%9d%80%e6%ad%a5%e9%aa%a4\/","title":{"rendered":"\u75c5\u6bd2\u7684\u67e5\u6740\u6b65\u9aa4"},"content":{"rendered":"<div class='wxsyncmain'>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">1.\u67e5\u770bCPU\u5360\u7528\u60c5\u51b5<\/span><\/strong><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"properties\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">top<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">S<\/span> <span class=\"code-snippet__string\">\u2014\u8fdb\u7a0b\u72b6\u6001\u3002D=\u4e0d\u53ef\u4e2d\u65ad\u7684\u7761\u7720\u72b6\u6001 R=\u8fd0\u884c S=\u7761\u7720 T=\u8ddf\u8e2a\/\u505c\u6b62 Z=\u50f5\u5c38\u8fdb\u7a0b<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">%CPU<\/span> <span class=\"code-snippet__string\">\u2014 \u4e0a\u6b21\u66f4\u65b0\u5230\u73b0\u5728\u7684CPU\u65f6\u95f4\u5360\u7528\u767e\u5206\u6bd4<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__meta\">%MEM<\/span> <span class=\"code-snippet__string\">\u2014 \u8fdb\u7a0b\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u767e\u5206\u6bd4<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attr\">TIME+&nbsp;\u2014&nbsp;\u8fdb\u7a0b\u4f7f\u7528\u7684CPU\u65f6\u95f4\u603b\u8ba1\uff0c\u5355\u4f4d1\/100\u79d2<\/span><\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">2.\u6740\u6389\u76f8\u5173\u8fdb\u7a0b<\/span><\/strong><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"bash\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__built_in\">kill<\/span> -9 pid<\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">3.\u5220\u9664\u76f8\u5173\u7684\u5b9a\u65f6\u4efb\u52a1\u548c\u811a\u672c<\/span><\/strong><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"nginx\"><code><span class=\"code-snippet_outer\">\u67e5\u627e\u6587\u4ef6\uff1a<span class=\"code-snippet__attribute\">find<\/span> \/ -name xbash<\/span><\/code><code><span class=\"code-snippet_outer\">\u67e5\u627e\u5e76\u5220\u9664\uff08\u614e\u7528-\u6015\u51fa\u9519\u5c3d\u91cf\u624b\u52a8\u5220\u9664\uff09\uff1afind \/&nbsp;-name xbash |xargs rm -rf<\/span><\/code><code><span class=\"code-snippet_outer\">\u5220\u9664\u65e0\u5173\u5b9a\u65f6\u4efb\u52a1\uff1avi \/etc\/crontab<\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">4.\u4fee\u6539\u6587\u4ef6\u64cd\u4f5c\u6743\u9650<br  \/><\/span><\/strong><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"nginx\"><code><span class=\"code-snippet_outer\">\u5173\u95ed\u6587\u4ef6\u64cd\u4f5c\u6743\u9650\uff0c\u4e3a\u53ea\u8bfb\u72b6\u6001\uff1a<span class=\"code-snippet__attribute\">chattr<\/span>&nbsp;+i&nbsp;crontab<\/span><\/code><code><span class=\"code-snippet_outer\">\u67e5\u770b\u6587\u4ef6\u64cd\u4f5c\u6743\u9650\u6743\u9650\uff1alsattr crontab<\/span><\/code><code><span class=\"code-snippet_outer\">\u663e\u793a\u6587\u4ef6\u5c5e\u6027\uff1alsattr<\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">5.\u4fee\u6539\u670d\u52a1\u5668\u767b\u5f55\u5bc6\u7801<\/span><\/strong><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code><span class=\"code-snippet_outer\">passwd<\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">6.\u4fee\u6539\u654f\u611f\u7aef\u53e3<\/span><\/strong><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code><span class=\"code-snippet_outer\">\/etc\/ssh\/sshd_config<\/span><\/code><code><span class=\"code-snippet_outer\">\u4fee\u6539Port\u4e3a\u966422\u4ee5\u5916\u7684\u7aef\u53e3<\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">7.\u67e5\u770b\u9632\u706b\u5899\u72b6\u6001-\u4fdd\u6301\u542f\u52a8\u72b6\u6001<\/span><\/strong><br  \/><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"nginx\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__attribute\">service<\/span>&nbsp;firewalld&nbsp;status<\/span><\/code><\/pre>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">8.\u6dfb\u52a0\u767d\u540d\u5355iptables<\/span><\/strong><br  \/><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"cs\"><code><span class=\"code-snippet_outer\">\u7aef\u53e3\u767d\u540d\u5355\u8def\u5f84\uff1a\/etc\/firewalld\/zones\/<span class=\"code-snippet__keyword\">public<\/span>.xml<\/span><\/code><code><span class=\"code-snippet_outer\">\u663e\u793a\u6240\u6709\u767d\u540d\u5355\u4e2d\u7aef\u53e3\uff1afirewall-cmd --zone=<span class=\"code-snippet__keyword\">public<\/span> --list-ports<\/span><\/code><code><span class=\"code-snippet_outer\">\u6dfb\u52a0\u7aef\u53e3\u5230\u767d\u540d\u5355\uff1afirewall-cmd --permanent --zone=<span class=\"code-snippet__keyword\">public<\/span> --<span class=\"code-snippet__keyword\">add<\/span>-port=<span class=\"code-snippet__number\">8992<\/span>\/tcp<\/span><\/code><code><span class=\"code-snippet_outer\">\u91cd\u65b0\u8f7d\u5165\uff1afirewall-cmd --reload<\/span><\/code><code><span class=\"code-snippet_outer\">\u4ece\u767d\u540d\u5355\u5220\u9664\u7aef\u53e3\uff1a\u76f4\u63a5\u4fee\u6539<span class=\"code-snippet__keyword\">public<\/span>\u6587\u4ef6\uff0c\u7136\u540ereload\u3002<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">9.\u91cd\u542f\u65e5\u5fd7\u670d\u52a1<\/span><\/strong><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"javascript\"><code><span class=\"code-snippet_outer\">\u7cfb\u7edf\u65e5\u5fd7\u76ee\u5f55\uff1a\/<span class=\"code-snippet__keyword\">var<\/span>\/log\/<\/span><\/code><code><span class=\"code-snippet_outer\">\u91cd\u542f\u670d\u52a1\uff1aservice rsyslog start<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-bottom: 0px;\"><strong><span style=\"font-size: 16px;\">10.\u7edf\u8ba1\u67d0\u6587\u4ef6\u5939\u4e0b\u6587\u4ef6\u4e2a\u6570<\/span><\/strong><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"bash\"><code><span class=\"code-snippet_outer\"> <span class=\"code-snippet__keyword\">for<\/span> i <span class=\"code-snippet__keyword\">in<\/span> foldName; <span class=\"code-snippet__keyword\">do<\/span> <span class=\"code-snippet__built_in\">echo<\/span> <span class=\"code-snippet__variable\">$i<\/span>; find <span class=\"code-snippet__variable\">$i<\/span> |wc -l|sort -nr; <span class=\"code-snippet__keyword\">done<\/span><\/span><\/code><\/pre>\n<\/section>\n<p style=\"line-height: 1.75em;margin-bottom: 8px;text-indent: 2em;\"><span style=\"font-size: 16px;letter-spacing: 1px;\">\u4e0a\u8ff0\u547d\u4ee4\u6267\u884c\u5b8c\u6bd5\u540e\uff0c\u89c2\u5bdf\u5185\u5b58\u5360\u7528\u60c5\u51b5\uff0c\u5e76\u627e\u5bf9\u5e94\u7684\u670d\u52a1\u5668\u5382\u5546\uff0c\u5b89\u88c5\u6740\u6bd2\u8f6f\u4ef6\uff0c\u5bf9\u75c5\u6bd2\u505a\u8fdb\u4e00\u6b65\u67e5\u6740\u3002<\/span><\/p>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u6570\u636e\u4e0e\u5171\u4eab              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>1.\u67e5\u770bCPU\u5360\u7528\u60c5\u51b5 topS \u2014\u8fdb\u7a0b\u72b6\u6001\u3002D=\u4e0d\u53ef\u4e2d\u65ad\u7684\u7761\u7720\u72b6\u6001 R=\u8fd0\u884c S=\u7761\u7720 T=\u8ddf\u8e2a\/\u505c\u6b62 Z=\u50f5\u5c38\u8fdb\u7a0b%CPU \u2014 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":2430,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-2431","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627154912932-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627154912932-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627154912932-1024x435.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627154912932-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627154912932-1024x435.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627154912932.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"\u672a\u5206\u7c7b","post_date":"2023-06-29","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":278,"next_post_id":2969,"next_post_title":"\u7b80\u5316\u672c\u5730Feign\u8c03\u7528\uff0c\u8001\u624b\u6559\u4f60\u8fd9\u4e48\u73a9","previous_post_id":2466,"previous_post_title":"\u672c\u5730\u7f13\u5b58\u4e4b\u738b\uff0cCaffeine\u4fdd\u59c6\u7ea7\u6559\u7a0b","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2431"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2431\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/2430"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}