{"id":1370,"date":"2023-08-25T09:22:08","date_gmt":"2023-08-25T01:22:08","guid":{"rendered":"https:\/\/blog.langsasec.cn\/?p=1370"},"modified":"2023-08-25T09:23:25","modified_gmt":"2023-08-25T01:23:25","slug":"warmuppc","status":"publish","type":"post","link":"https:\/\/blog.langsasec.cn\/index.php\/2023\/08\/25\/warmuppc\/","title":{"rendered":"warmup\u6316\u77ff\u6392\u67e5\u5904\u7f6e\u624b\u518c"},"content":{"rendered":"<blockquote>\n<p>\u672c\u6b21\u6392\u67e5\u5904\u7406\u4ec5\u9002\u7528\u4e8e linux \u7cfb\u7edf\u3002<\/p>\n<\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"%e4%b8%80%e3%80%81%e6%8e%92%e6%9f%a5%e8%a6%81%e7%82%b9%e5%8f%8a%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\"><\/span>\u4e00\u3001\u6392\u67e5\u8981\u70b9\u53ca\u6ce8\u610f\u4e8b\u9879<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u9488\u5bf9\u6316\u77ff\u6728\u9a6c\u6392\u67e5\uff0c\u4e3b\u8981\u9488\u5bf9\u7684\u662f\u8fdb\u7a0b\u4fe1\u606f\uff0c\u7f51\u7edc\u8fde\u63a5\uff0cCPU \u53ca\u5185\u5b58\u5360\u7528\uff0c\u6587\u4ef6\uff0c\u8ba1\u5212\u4efb\u52a1\uff0c\u5f00\u673a\u81ea\u542f\u52a8\u3002<\/p>\n<p>\u6316\u77ff\u5173\u952e\u5b57\uff1axrmig\uff0cwarmup\uff0cximetd(\u7aef\u53e3\u76d1\u542c\u7a0b\u5e8f)\uff0cnc\uff08\u7aef\u53e3\u76d1\u542c\uff0c\u9ed1\u5ba2\u5de5\u5177\uff09\u3002<\/p>\n<p><strong>\u5c0f\u8d34\u58eb\uff1a<\/strong><\/p>\n<blockquote>\n<p>\u5bf9\u5e94\u66f4\u7ec6\u8282\u547d\u4ee4\u53ef\u67e5\u770b linux \u547d\u4ee4\u5927\u5168\uff1a<a href=\"https:\/\/www.linuxcool.com\/\">https:\/\/www.linuxcool.com\/<\/a><\/p>\n<p>\u67e5\u8be2\u53ef\u7591\u6076\u610f IP \u6216\u94fe\u63a5\uff08\u4ec5\u9650\u4e92\u8054\u7f51\uff09\uff1a<a href=\"https:\/\/x.threatbook.com\/\">https:\/\/x.threatbook.com\/<\/a><\/p>\n<\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"%e4%ba%8c%e3%80%81%e6%8e%92%e6%9f%a5%e6%b5%81%e7%a8%8b\"><\/span>\u4e8c\u3001\u6392\u67e5\u6d41\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1-%e6%98%af%e5%90%a6%e5%ad%98%e5%9c%a8%e6%8c%96%e7%9f%bf%e7%a8%8b%e5%ba%8f\"><\/span>1. \u662f\u5426\u5b58\u5728\u6316\u77ff\u7a0b\u5e8f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u67e5\u770b\u662f\u5426\u6709\u6316\u77ff\u811a\u672c\u7a0b\u5e8f\uff0c\u5982\u679c\u6709\u8f93\u51fa\u5219\u8bf4\u660e\u6316\u77ff\u7a0b\u5e8f\u88ab\u690d\u5165\u3002<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">find \/ -type f -name &quot;somescript&quot;<\/code><\/pre>\n<p>\u67e5\u770b\u78c1\u76d8\u662f\u5426\u6709 warmup \u8be5\u7a0b\u5e8f\uff0c\u5982\u679c\u6709\u8f93\u51fa\u5219\u8bf4\u660e\u6316\u77ff\u7a0b\u5e8f\u88ab\u690d\u5165\u3002<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">find \/ -name warmup<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"2-%e6%98%af%e5%90%a6%e5%ad%98%e5%9c%a8%e6%8c%96%e7%9f%bf%e8%bf%9b%e7%a8%8b\"><\/span>2. \u662f\u5426\u5b58\u5728\u6316\u77ff\u8fdb\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u67e5\u770b\u6240\u6709\u8fdb\u7a0b\u4fe1\u606f\uff0c\u82e5\u5b58\u5728\u5173\u952e\u5b57\u4fe1\u606f\u8bf4\u660e\u5b58\u5728\u6316\u77ff<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">ps -ef<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"3-%e6%98%af%e5%90%a6%e6%9c%89%e5%a4%96%e8%bf%9e-ip-%e5%8f%8a%e5%af%b9%e5%ba%94%e7%a8%8b%e5%ba%8f\"><\/span>3. \u662f\u5426\u6709\u5916\u8fde IP \u53ca\u5bf9\u5e94\u7a0b\u5e8f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u53d1\u73b0\u5982\u4e0b\u547d\u4ee4\u5982\u6709\u5916\u8fde IP <code>5.133.65.53 <\/code>\u53ca\u5176 c \u6bb5\u5730\u5740\uff0c\u5219\u8bf4\u660e\u6316\u77ff\u7a0b\u5e8f\u6b63\u5728\u8fd0\u884c\u3002<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">netstat -tnap<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"4-%e6%98%af%e5%90%a6%e6%8c%96%e7%9f%bf%e7%a8%8b%e5%ba%8f%e5%8d%a0%e7%94%a8%e5%a4%a7%e9%87%8f-cpu-%e6%88%96%e5%86%85%e5%ad%98\"><\/span>4. \u662f\u5426\u6316\u77ff\u7a0b\u5e8f\u5360\u7528\u5927\u91cf CPU \u6216\u5185\u5b58<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5982\u679c\u5b58\u5728\u6316\u77ff\u7a0b\u5e8f\uff0cCPU \u6216\u5185\u5b58\u4e2d\u4f1a\u5360\u6bd4\u8f83\u5927\uff0c\u672c\u6b21 warmup \u5360\u7528\u5185\u5b58 50% \u5de6\u53f3<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">top<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"5-%e6%98%af%e5%90%a6%e5%ad%98%e5%9c%a8%e6%8c%96%e7%9f%bf%e8%ae%a1%e5%88%92%e4%bb%bb%e5%8a%a1%e5%91%bd%e4%bb%a4\"><\/span>5. \u662f\u5426\u5b58\u5728\u6316\u77ff\u8ba1\u5212\u4efb\u52a1\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5982\u679c\u5b58\u5728\u8ba1\u5212\u4efb\u52a1\uff0c\u5c06\u5e26\u6076\u610f\u6316\u77ff\u547d\u4ee4\u53ca\u8fd0\u884c\u6316\u6846\u811a\u672c\u7684\u8ba1\u5212\u4efb\u52a1\u8fdb\u884c\u5220\u9664\u3002<\/p>\n<p>\u67e5\u770b\u5f53\u524d\u7528\u6237\u7684\u5df2\u6709\u8ba1\u5212\u4efb\u52a1\u5217\u8868\uff1a<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">crontab -l <\/code><\/pre>\n<p>\u7f16\u8f91\u7ba1\u7406\u8ba1\u5212\u4efb\u52a1\uff0c\u53ef\u8fdb\u884c\u5220\u9664\u4fee\u6539<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">crontab -e<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"6-%e6%98%af%e5%90%a6%e5%ad%98%e5%9c%a8%e5%bc%80%e6%9c%ba%e5%90%af%e5%8a%a8%e9%a1%b9\"><\/span>6. \u662f\u5426\u5b58\u5728\u5f00\u673a\u542f\u52a8\u9879<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5982\u679c\u5b58\u5728 ximetd \u6709 on \u9009\u9879\uff0c\u9700\u8981\u5c06\u5176\u5173\u95ed\uff0c\u8bbe\u7f6e\u4e3aoff<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">chkconfig<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%e4%b8%89%e3%80%81%e5%a4%84%e7%bd%ae%e6%b5%81%e7%a8%8b\"><\/span>\u4e09\u3001\u5904\u7f6e\u6d41\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1-%e6%89%a7%e8%a1%8c%e8%84%9a%e6%9c%ac\"><\/span>1. \u6267\u884c\u811a\u672c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<blockquote>\n<p>\u6267\u884c\u524d\u5982\u6709\u9700\u8981\u5206\u6790\u53ef\u5c06\u6837\u672c\u4fdd\u5b58\u518d\u6267\u884c\u547d\u4ee4<\/p>\n<\/blockquote>\n<p>\u521b\u5efa\u811a\u672c\u6587\u4ef6<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">touch clean.sh<\/code><\/pre>\n<p>\u6253\u5f00\u5e76\u5199\u5165\u811a\u672c<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">vi clean.sh<\/code><\/pre>\n<p>\u811a\u672c\u4e00\uff08\u5b58\u5728 systemctl \u547d\u4ee4\uff09\uff1a<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">#!\/bin\/bash\n\n# \u505c\u6b62warmup\u670d\u52a1\nsystemctl stop warmup\nsystemctl disable warmup\nsystemctl daemon-reload\n# \u5220\u9664\u6587\u4ef6\u548c\u76ee\u5f55\nrm -rf \/etc\/alternatives\/.warmup\nrm -rf \/etc\/alternatives\/.warmup\/warmup\nrm -rf \/etc\/systemd\/system\/warmup.service\nrm -rf \/root\/.warmup\nrm -rf \/root\/.warmup\/warmup\n# \u5220\u9664\u6587\u4ef6\u548c\u76ee\u5f55\nrm -rf \/etc\/xtab\/somescript\nrm -rf \/etc\/cron.hourly\/somescript\nrm -rf \/etc\/cron.hourly\/.somescript\nrm -rf \/etc\/xtab\n# \u5220\u9664\u76ee\u5f55\u53ca\u5176\u5185\u5bb9\nrm -rf \/etc\/init.d\/modules\nrm -rf \/etc\/rc.d\/init.d\/modules\n# \u5173\u95edxinetd\nsystemctl stop xinetd\nsystemctl disable xinetd<\/code><\/pre>\n<p>\u811a\u672c\u4e8c\uff08\u4e0d\u5b58\u5728 systemctl \u547d\u4ee4\uff09\uff1a<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">#!binbash\n\n# \u505c\u6b62warmup\u670d\u52a1\nservice warmup stop\nchkconfig warmup off\n# \u5220\u9664\u6587\u4ef6\u548c\u76ee\u5f55\nrm -rf \/etc\/alternatives\/.warmup\nrm -rf \/etc\/alternatives\/.warmup\/warmup\nrm -rf \/etc\/systemd\/system\/warmup.service\nrm -rf \/root\/.warmup\nrm -rf \/root\/.warmup\/warmup\n# \u5220\u9664\u6587\u4ef6\u548c\u76ee\u5f55\nrm -rf \/etc\/xtab\/somescript\nrm -rf \/etc\/cron.hourly\/somescript\nrm -rf \/etc\/cron.hourly\/.somescript\nrm -rf \/etc\/xtab\n# \u5220\u9664\u76ee\u5f55\u53ca\u5176\u5185\u5bb9\nrm -rf \/etc\/init.d\/modules\nrm -rf \/etc\/rc.d\/init.d\/modules\n# \u5173\u95edxinetd\nservice xinetd stop\nchkconfig xinetd off<\/code><\/pre>\n<p>\u7ed9\u6587\u4ef6\u6267\u884c\u6743\u9650\u5e76\u6267\u884c<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">chmod +x clean.sh\n.\/clean.sh<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"2-%e6%a3%80%e6%9f%a5%e8%bf%9b%e7%a8%8b\"><\/span>2. \u68c0\u67e5\u8fdb\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u91cd\u590d\u6392\u67e5\u6240\u6267\u884c\u7684\u547d\u4ee4\u786e\u4fdd\u65e0\u5f02\u5e38\u5373\u53ef\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%e5%9b%9b%e3%80%81%e7%89%b9%e6%ae%8a%e6%83%85%e5%86%b5\"><\/span>\u56db\u3001\u7279\u6b8a\u60c5\u51b5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5982\u679c\u5b58\u5728 nc \u8fdb\u7a0b\u53ca\u5916\u8fde\u53ef\u8fdb\u884c\u5982\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<p>\u5173\u95ed\u6240\u6709\u8fde\u5e26 nc \u7684\u8fdb\u7a0b<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">pkill -f nc<\/code><\/pre>\n<p>\u627e\u5230 nc \u5e76\u5220\u9664<\/p>\n<pre class=\"prettyprint linenums\" ><code class=\"language-sh\">find \/ -name nc\n\nrm -rf nc\u7684\u8def\u5f84<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6b21\u6392\u67e5\u5904\u7406\u4ec5\u9002\u7528\u4e8e linux \u7cfb\u7edf\u3002 \u4e00\u3001\u6392\u67e5\u8981\u70b9\u53ca\u6ce8\u610f\u4e8b\u9879 \u9488\u5bf9\u6316\u77ff\u6728\u9a6c\u6392\u67e5\uff0c\u4e3b\u8981\u9488\u5bf9\u7684\u662f\u8fdb\u7a0b\u4fe1\u606f\uff0c\u7f51\u7edc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-1370","post","type-post","status-publish","format-standard","hentry","category-yjxy"],"_links":{"self":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1370"}],"version-history":[{"count":2,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1370\/revisions"}],"predecessor-version":[{"id":1373,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/posts\/1370\/revisions\/1373"}],"wp:attachment":[{"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.langsasec.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}