{"id":40374,"date":"2026-08-26T00:52:57","date_gmt":"2026-08-25T17:52:57","guid":{"rendered":"https:\/\/dps.media\/?p=40374"},"modified":"2026-08-26T00:52:57","modified_gmt":"2026-08-25T17:52:57","slug":"optimize-server-performance-cyberpanel","status":"publish","type":"post","link":"https:\/\/dps.media\/zh\/optimize-server-performance-cyberpanel\/","title":{"rendered":"CyberPanel\u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316\uff1a\u9ad8\u8d1f\u8f7dVPS\u76847\u5c42\u4f18\u5316\u624b\u518c"},"content":{"rendered":"<p>\u62e5\u6709\u4e00\u53f0\u914d\u5907 8 \u6838 CPU \u548c 16GB \u6216 32GB RAM \u7684\u670d\u52a1\u5668\uff0c\u4f46 WordPress \u7f51\u7ad9\u4ecd\u7ecf\u5e38\u51fa\u73b0\u5361\u987f\u3001\u5ef6\u8fdf\uff0cCPU \u8fbe\u5230 100% \u6216\u5728\u5e7f\u544a\u6d3b\u52a8\u6d41\u91cf\u6d8c\u5165\u65f6\u5b95\u673a\uff1f\u95ee\u9898\u51e0\u4e4e\u4e0d\u5728\u786c\u4ef6\uff0c\u800c\u5728\u4e8e\u670d\u52a1\u5668\u5c1a\u672a\u7ecf\u8fc7\u51c6\u786e\u8c03\u4f18\u3002CyberPanel \u548c Linux \u64cd\u4f5c\u7cfb\u7edf\u7684\u9ed8\u8ba4\u914d\u7f6e\u901a\u5e38\u4ec5\u8bbe\u7f6e\u5728\u6700\u4f4e\u5b89\u5168\u7ea7\u522b\uff0c\u4ee5\u786e\u4fdd\u5176\u80fd\u591f\u5728\u5ec9\u4ef7\u7684 1GB RAM VPS \u5957\u9910\u4e0a\u8fd0\u884c\u3002<\/p><p>\u4e3a\u4e86\u5145\u5206\u91ca\u653e\u786c\u4ef6\u6027\u80fd\uff0c\u4f18\u5316\u6d41\u7a0b <a href=\"https:\/\/dps.media\/zh\/optimize-server-performance-cyberpanel\/\">\u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316<\/a> \u8981\u6c42\u4ece Linux \u5185\u6838\uff08Kernel\uff09\u3001\u7cfb\u7edf\u8fdb\u7a0b\u9650\u5236\u3001MariaDB \u6570\u636e\u5e93\u3001PHP 8.x \u89e3\u91ca\u5f15\u64ce\u3001OpenLiteSpeed Web \u670d\u52a1\u5668\uff0c\u5230 Redis \u7f13\u5b58\u548c WordPress \u5e94\u7528\u8fdb\u884c\u540c\u6b65\u5c42\u9762\u7684\u5e72\u9884\u3002<\/p><p>\u4ee5\u4e0b\u662f DPS.MEDIA \u6280\u672f\u56e2\u961f\u901a\u8fc7\u6570\u767e\u4e2a\u9ad8\u8d1f\u8f7d\u670d\u52a1\u5668\u90e8\u7f72\u9879\u76ee\u603b\u7ed3\u51fa\u7684 7 \u5c42\u5b9e\u6218\u4f18\u5316\u624b\u518c\uff0c\u9002\u7528\u4e8e\u7535\u5b50\u5546\u52a1\u5e73\u53f0\u548c\u591a\u7f51\u7ad9\u751f\u6001\u7cfb\u7edf\u3002<\/p><p><img decoding=\"async\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2026\/08\/toi_uu_hieu_suat_server_cyberp_img2_1787649791044.png\" alt=\"\u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316\" style=\"display:block;margin:20px auto;max-width:100%;height:auto\" title=\"\"><\/p><h2>\u7b2c1\u5c42\uff1a\u8c03\u6574Linux Kernel\u5185\u6838\u5c42\uff08\/etc\/sysctl.conf\uff09<\/h2><p>Linux \u5185\u6838\u5c42\u8d1f\u8d23\u534f\u8c03\u786c\u4ef6\u8d44\u6e90\u548c TCP \u7f51\u7edc\u961f\u5217\u3002\u5728\u9ed8\u8ba4\u914d\u7f6e\u4e0b\uff0c\u5373\u4f7f\u7269\u7406 RAM \u4ecd\u6709\u5927\u91cf\u5269\u4f59\uff0cLinux \u4e5f\u5f88\u5bb9\u6613\u5c06\u7f13\u5b58\u5185\u5b58\u63a8\u9001\u5230\u786c\u76d8\uff08Swap\uff09\uff0c\u540c\u65f6\u5c06\u5e76\u53d1\u8fde\u63a5\u6570\u91cf\u9650\u5236\u5728\u975e\u5e38\u4f4e\u7684\u6c34\u5e73\u3002<\/p><p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6253\u5f00\u7cfb\u7edf\u914d\u7f6e\u6587\u4ef6\uff1a <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/sysctl.conf<\/code> \u5e76\u5728\u6587\u4ef6\u672b\u5c3e\u8865\u5145\u4ee5\u4e0b 4 \u7ec4\u6838\u5fc3\u53c2\u6570\uff1a<\/p><ul>\n<li><strong>1. \u4f18\u5316\u5185\u5b58\u4e0e Swap\uff1a<\/strong>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">vm.swappiness = 10<\/code> \uff08\u4ec5\u5728 RAM \u786e\u5b9e\u8017\u5c3d\u81f3 10% \u4ee5\u4e0b\u65f6\u4f7f\u7528 Swap\uff09\u3002.<\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">vm.vfs_cache_pressure = 50<\/code> \uff08\u8ba9 inode \u548c\u76ee\u5f55\u7f13\u5b58\u66f4\u957f\u65f6\u95f4\u4fdd\u7559\u5728 RAM \u4e2d\uff09\u3002.<\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">vm.dirty_background_ratio = 5<\/code> & <code class=\"notranslate no-translate\" data-no-translation=\"\">vm.dirty_ratio = 10<\/code> \uff08\u8ba9\u6570\u636e\u4ece RAM \u5e73\u7a33\u5199\u5165 SSD\uff09\u3002.\n  <\/p>\n<\/li>\n<li><strong>2. \u6269\u5c55\u7cfb\u7edf\u6587\u4ef6\u63cf\u8ff0\u7b26\uff1a<\/strong>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">fs.file-max = 2097152<\/code> \uff08\u5141\u8bb8\u540c\u65f6\u6253\u5f00\u8d85\u8fc7 200 \u4e07\u4e2a\u6587\u4ef6\uff09\u3002.<\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">fs.inotify.max_user_watches = 524288<\/code>\n  <\/p>\n<\/li>\n<li><strong>3. \u6269\u5c55 TCP \u961f\u5217\u4e0e\u590d\u7528\u8fde\u63a5\uff1a<\/strong>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.core.somaxconn = 65535<\/code> & <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.tcp_max_syn_backlog = 65535<\/code> \uff08\u6700\u5927 socket \u961f\u5217\uff09\u3002.<\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.core.netdev_max_backlog = 65536<\/code><\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.tcp_tw_reuse = 1<\/code> & <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.tcp_fin_timeout = 15<\/code> \uff0815 \u79d2\u540e\u56de\u6536 TIME_WAIT socket\uff09\u3002.<\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.tcp_keepalive_time = 300<\/code><\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.ip_local_port_range = 1024 65535<\/code> \uff08\u6269\u5c55\u51fa\u7ad9\u7aef\u53e3\u8303\u56f4\uff09\u3002.\n  <\/p>\n<\/li>\n<li><strong>4. \u589e\u52a0\u7f51\u7edc Buffer \u5bb9\u91cf\uff1a<\/strong>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.core.rmem_max = 16777216<\/code> & <code class=\"notranslate no-translate\" data-no-translation=\"\">net.core.wmem_max = 16777216<\/code> \uff08\u5206\u914d 16MB Buffer\uff09\u3002.<\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.tcp_rmem = 4096 87380 16777216<\/code><\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.tcp_wmem = 4096 65536 16777216<\/code><\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">net.ipv4.tcp_syncookies = 1<\/code> \uff08\u9632\u6b62 TCP SYN \u961f\u5217\u6ea2\u51fa\uff09\u3002.\n  <\/p>\n<\/li>\n<\/ul><p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u7acb\u5373\u542f\u7528\u65b0\u914d\u7f6e\uff0c\u65e0\u9700\u91cd\u542f\u670d\u52a1\u5668\uff1a<\/p><p><code class=\"notranslate no-translate\" data-no-translation=\"\">sysctl -p<\/code><\/p><p><img decoding=\"async\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2026\/08\/toi_uu_hieu_suat_server_cyberp_img2_1787649791044.png\" alt=\"\u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316\" style=\"display:block;margin:20px auto;max-width:100%;height:auto\" title=\"\"><\/p><h2>\u7b2c2\u5c42\uff1a\u6269\u5c55\u64cd\u4f5c\u7cfb\u7edf\u8d44\u6e90\u9650\u5236\uff08\/etc\/security\/limits.conf\uff09<\/h2><p>\u5f53\u8bbf\u95ee\u91cf\u7a81\u7136\u6fc0\u589e\u65f6\uff0c\u7f51\u7ad9\u7a81\u7136\u8fd4\u56de 500 \u6216 502 Bad Gateway \u9519\u8bef\uff0c\u901a\u5e38\u6e90\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u89e6\u53ca\u540c\u65f6\u6253\u5f00\u6587\u4ef6\u6570\u91cf\u7684\u4e0a\u9650\uff08Too many open files\uff09\u3002\u6bcf\u4e2a\u7528\u6237\u8fde\u63a5\u3001\u56fe\u7247\u6587\u4ef6\u3001\u6570\u636e\u5e93\u67e5\u8be2\u6216 PHP \u8fdb\u7a0b\u90fd\u4f1a\u6d88\u8017\u4e00\u4e2a File Descriptor\u3002.<\/p><p>\u6253\u5f00\u6587\u4ef6 <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/security\/limits.conf<\/code> \u5e76\u5728\u4ee5\u4e0b\u884c\u4e4b\u524d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9 <code class=\"notranslate no-translate\" data-no-translation=\"\"># End of file<\/code> \u4ee5\u89e3\u9664\u7cfb\u7edf\u7528\u6237\u7684\u9650\u5236\uff08<code class=\"notranslate no-translate\" data-no-translation=\"\">*<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">root<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">mysql<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">nobody<\/code>):<\/p><ul>\n<li><strong>\u540c\u65f6\u6253\u5f00\u6587\u4ef6\u6570\u91cf\u9650\u5236\uff08nofile\uff09\uff1a<\/strong> \u8bbe\u7f6e <code class=\"notranslate no-translate\" data-no-translation=\"\">soft nofile 65535<\/code> \u548c <code class=\"notranslate no-translate\" data-no-translation=\"\">hard nofile 65535<\/code> \u9002\u7528\u4e8e\u6240\u6709\u8fdb\u7a0b\u3002.<\/li>\n<li><strong>\u540c\u65f6\u8fd0\u884c\u8fdb\u7a0b\u6570\u91cf\u9650\u5236\uff08nproc\uff09\uff1a<\/strong> \u8bbe\u7f6e <code class=\"notranslate no-translate\" data-no-translation=\"\">soft nproc 65535<\/code> \u548c <code class=\"notranslate no-translate\" data-no-translation=\"\">hard nproc 65535<\/code>.<\/li>\n<li><strong>\u5185\u5b58\u9501\u5b9a\uff08memlock\uff09\uff1a<\/strong> \u8bbe\u7f6e <code class=\"notranslate no-translate\" data-no-translation=\"\">soft memlock unlimited<\/code> \u548c <code class=\"notranslate no-translate\" data-no-translation=\"\">hard memlock unlimited<\/code>.<\/li>\n<\/ul><h2>\u7b2c3\u5c42\uff1a\u4f18\u5316RAM\u4e0a\u7684MariaDB\u6570\u636e\u5e93\uff08\/etc\/mysql\/mariadb.conf.d\/99-tuning.cnf\uff09<\/h2><p>\u5927\u591a\u6570 WordPress \u7f51\u7ad9\u6700\u5927\u7684\u74f6\u9888\u6b63\u662f\u6570\u636e\u5e93\u786c\u76d8\u8bfb\u5199\u901f\u5ea6\u3002\u901a\u8fc7\u5c06\u5927\u90e8\u5206\u6570\u636e\u548c\u8868\u7d22\u5f15\u5206\u914d\u5230 RAM \u5185\u5b58\u533a\u57df\uff08InnoDB Buffer Pool\uff09\uff0c\u67e5\u8be2\u54cd\u5e94\u901f\u5ea6\u53ef\u4ee5\u63d0\u5347 5 \u5230 10 \u500d\u3002.<\/p><h3>innodb_buffer_pool_size\u7684RAM\u5206\u914d\u516c\u5f0f\uff1a<\/h3><table style=\"width:100%;border-collapse: collapse;margin: 15px 0\">\n<thead>\n<tr style=\"background-color: #f2f4f8;text-align: left\">\n<th style=\"border: 1px solid #ddd;padding: 10px\">\u7269\u7406 RAM \u914d\u7f6e<\/th>\n<th style=\"border: 1px solid #ddd;padding: 10px\">\u5206\u914d\u7ed9 Buffer Pool \u7684\u5bb9\u91cf<\/th>\n<th style=\"border: 1px solid #ddd;padding: 10px\">Instances \u6570\u91cf<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border: 1px solid #ddd;padding: 10px\">8GB RAM VPS<\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\">3GB \u2013 4GB<\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\">1 \u2013 4<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ddd;padding: 10px\">16GB RAM \u670d\u52a1\u5668<\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\">6GB \u2013 8GB<\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\">4 \u2013 8<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ddd;padding: 10px\">24GB \u2013 32GB RAM \u670d\u52a1\u5668<\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\"><strong>8GB \u2013 12GB<\/strong><\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\">8<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ddd;padding: 10px\">64GB+ RAM \u72ec\u7acb\u670d\u52a1\u5668<\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\">32GB<\/td>\n<td style=\"border: 1px solid #ddd;padding: 10px\">16<\/td>\n<\/tr>\n<\/tbody>\n<\/table><p>\u521b\u5efa\u72ec\u7acb\u914d\u7f6e\u6587\u4ef6 <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/mysql\/mariadb.conf.d\/99-tuning.cnf<\/code> \u5e76\u4f7f\u7528\u4ee5\u4e0b\u4f18\u5316\u53c2\u6570\uff1a<\/p><ul>\n<li><strong>InnoDB Engine\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">innodb_buffer_pool_size = 8G<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">innodb_buffer_pool_instances = 8<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">innodb_log_file_size = 1G<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">innodb_log_buffer_size = 64M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">innodb_flush_log_at_trx_commit = 2<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">innodb_io_capacity = 2000<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">innodb_io_capacity_max = 4000<\/code>.<\/li>\n<li><strong>\u8fde\u63a5\u4e0e\u67e5\u8be2\u7f13\u5b58\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">max_connections = 500<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">max_user_connections = 400<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">wait_timeout = 60<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">table_open_cache = 4000<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">tmp_table_size = 128M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">max_heap_table_size = 128M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">join_buffer_size = 8M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">sort_buffer_size = 8M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">max_allowed_packet = 128M<\/code>.<\/li>\n<\/ul><p>\u91cd\u542f MariaDB \u670d\u52a1\u5e76\u68c0\u67e5\u5b9e\u9645\u83b7\u5f97\u7684 RAM \u5bb9\u91cf\uff1a<\/p><p><code class=\"notranslate no-translate\" data-no-translation=\"\">systemctl restart mariadb<\/code><\/p><p><code class=\"notranslate no-translate\" data-no-translation=\"\">mysql -e \"SHOW VARIABLES LIKE 'innodb_buffer_pool_size';\"<\/code><\/p><h2>\u7b2c4\u5c42\uff1a\u4f18\u5316PHP 8.x Engine\u5f15\u64ce\u548cJIT Compiler\u7f16\u8bd1\u5668\uff08php.ini\uff09<\/h2><p>PHP 8.2 \u548c 8.3 \u51ed\u501f JIT\uff08Just-In-Time\uff09Compiler \u67b6\u6784\u5e26\u6765\u5353\u8d8a\u6027\u80fd\u3002\u7136\u800c\uff0c\u5982\u679c\u6ca1\u6709\u4e3a OPcache \u5206\u914d\u8db3\u591f\u7684\u5185\u5b58\u6765\u5b58\u50a8\u5df2\u7f16\u8bd1\u7684\u5b57\u8282\u7801\uff0cPHP \u5c31\u4f1a\u4e0d\u65ad\u4ece\u78c1\u76d8\u8bfb\u53d6\u6e90\u4ee3\u7801\uff0c\u6d6a\u8d39 CPU \u5904\u7406\u5468\u671f\u3002.<\/p><p>\u5728 CyberPanel \u754c\u9762\u4e2d\uff0c\u8fdb\u5165 <strong>PHP<\/strong> \u2192 <strong>\u7f16\u8f91 PHP \u914d\u7f6e<\/strong> \u2192 \u9009\u9879\u5361 <strong>\u9ad8\u7ea7<\/strong> \uff08\u6216\u7f16\u8f91\u6587\u4ef6 <code class=\"notranslate no-translate\" data-no-translation=\"\">\/usr\/local\/lsws\/lsphp83\/etc\/php.ini<\/code>):<\/p><ul>\n<li><strong>\u5185\u5b58\u4e0e\u6587\u4ef6\u9650\u5236\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">memory_limit = 1024M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">max_execution_time = 120<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">max_input_time = 60<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">max_input_vars = 10000<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">post_max_size = 256M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">upload_max_filesize = 256M<\/code>.<\/li>\n<li><strong>\u8def\u5f84\u4f18\u5316\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">realpath_cache_size = 16M<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">realpath_cache_ttl = 600<\/code>.<\/li>\n<li><strong>\u5173\u95ed\u5197\u4f59\u7edf\u8ba1\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">mysqlnd.collect_statistics = Off<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">mysqlnd.collect_memory_statistics = Off<\/code>.<\/li>\n<li><strong>\u542f\u7528 OPcache\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.enable = 1<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.memory_consumption = 512<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.interned_strings_buffer = 64<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.max_accelerated_files = 100000<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.validate_timestamps = 1<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.revalidate_freq = 60<\/code>.<\/li>\n<li><strong>\u542f\u7528 PHP 8.x JIT Compiler\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.jit = 1255<\/code>, <code class=\"notranslate no-translate\" data-no-translation=\"\">opcache.jit_buffer_size = 128M<\/code> \uff08\u52a0\u901f CPU \u8ba1\u7b97\uff09\u3002.<\/li>\n<\/ul><h2>\u7b2c5\u5c42\uff1a\u8c03\u6574OpenLiteSpeed Web\u670d\u52a1\u5668\uff08OLS WebAdmin\uff09<\/h2><p>OpenLiteSpeed \u91c7\u7528\u5f02\u6b65 Event-Driven \u6a21\u578b\uff0c\u80fd\u591f\u670d\u52a1\u6570\u4e07\u8fde\u63a5\u800c\u4e0d\u4f1a\u9020\u6210\u5185\u5b58\u6ea2\u51fa\u3002\u6839\u636e <a href=\"https:\/\/docs.openlitespeed.org\/\" target=\"_blank\" rel=\"noopener nofollow\">OpenLiteSpeed \u6280\u672f\u6587\u6863<\/a>, \u6b63\u786e\u8bbe\u7f6e Worker \u8fdb\u7a0b\u6570\u91cf\u5e76\u542f\u7528 Brotli \u538b\u7f29\u7b97\u6cd5\uff0c\u53ef\u4ee5\u5c06\u4f20\u8f93\u6570\u636e\u5305\u5927\u5c0f\u76f8\u6bd4\u4f20\u7edf GZIP \u51cf\u5c11 25%\u3002.<\/p><p>\u767b\u5f55\u5230 <strong>OpenLiteSpeed WebAdmin<\/strong> \u5728\u7aef\u53e3 <code class=\"notranslate no-translate\" data-no-translation=\"\">7080<\/code> \u7ed3\u5c3e\uff08\u4f8b\u5982\uff1a <code class=\"notranslate no-translate\" data-no-translation=\"\">https:\/\/YOUR_SERVER_IP:7080<\/code>) \u5e76\u6267\u884c\u4e24\u7ec4\u8bbe\u7f6e\uff1a<\/p><h3>1. \u8c03\u6574External Application\uff08lsphp\uff09\uff1a<\/h3><p>\u8fdb\u5165 <strong>\u670d\u52a1\u5668\u914d\u7f6e<\/strong> \u2192 <strong>External App<\/strong> \u2192 \u9009\u62e9\u7f16\u8f91 <strong>lsphp<\/strong>:<\/p><ul>\n<li><strong>Max Connections\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">150<\/code> \uff08\u6216 <code class=\"notranslate no-translate\" data-no-translation=\"\">200<\/code> \u9002\u7528\u4e8e 16 core \u670d\u52a1\u5668\uff09<\/li>\n<li><strong>Initial Request Timeout\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">60<\/code> | <strong>Retry Timeout\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">0<\/code><\/li>\n<li><strong>Persistent Connection\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">Yes<\/code> | <strong>Response Buffering\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">No<\/code><\/li>\n<li><strong>Environment\uff1a<\/strong> \u6dfb\u52a0\u4ee5\u4e0b\u4e24\u884c\u73af\u5883\u53d8\u91cf\uff1a\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">PHP_LSAPI_CHILDREN=150<\/code><\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">PHP_LSAPI_MAX_REQUESTS=5000<\/code>\n  <\/p>\n<\/li>\n<li><strong>Memory Limit\uff1a<\/strong> \u586b\u5199 <code class=\"notranslate no-translate\" data-no-translation=\"\">0<\/code> | <strong>Process Limit\uff1a<\/strong> \u586b\u5199 <code class=\"notranslate no-translate\" data-no-translation=\"\">1000<\/code> \uff08\u6216 <code class=\"notranslate no-translate\" data-no-translation=\"\">0<\/code>)<\/li>\n<\/ul><h3>2. \u542f\u7528 Brotli \u538b\u7f29\u548c Async SSL\uff1a<\/h3><p>\u8fdb\u5165 <strong>\u670d\u52a1\u5668\u914d\u7f6e<\/strong> \u2192 \u9009\u9879\u5361 <strong>Tuning<\/strong>:<\/p><ul>\n<li><strong>Max Connections\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">10000<\/code><\/li>\n<li><strong>Enable Async OpenSSL\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">Yes<\/code><\/li>\n<li><strong>Enable GZIP \/ Brotli Compression\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">Yes<\/code><\/li>\n<li><strong>Brotli Compression Level\uff1a<\/strong> \u8bbe\u7f6e\u4e3a <code class=\"notranslate no-translate\" data-no-translation=\"\">4<\/code> \uff08\u5728\u4e0d\u9020\u6210 CPU \u963b\u585e\u7684\u60c5\u51b5\u4e0b\u8fbe\u5230\u6700\u4f73\u538b\u7f29\u7387\uff09\u3002.<\/li>\n<\/ul><p>\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u7eff\u8272\u5706\u5f62\u56fe\u6807 <strong>\u4f18\u96c5\u91cd\u542f<\/strong> \u4ee5\u52a0\u8f7d\u65b0\u914d\u7f6e\u3002.<\/p><h2>\u7b2c6\u5c42\uff1a\u90e8\u7f72 Redis Object Cache \u5bf9\u8c61\u7f13\u5b58<\/h2><p>WordPress \u5728\u6bcf\u6b21\u9875\u9762\u52a0\u8f7d\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u8c03\u7528\u6570\u767e\u6761\u91cd\u590d\u67e5\u8be2\u3002\u4e0e\u5176\u8ba9\u6570\u636e\u5e93\u591a\u6b21\u5904\u7406\u540c\u4e00\u4e2a\u67e5\u8be2\uff0c\u4e0d\u5982\u4f7f\u7528 Redis Object Cache \u5c06\u8fd9\u4e9b\u7ed3\u679c\u76f4\u63a5\u5b58\u50a8\u5728 RAM \u4e2d\uff0c\u54cd\u5e94\u5ef6\u8fdf\u4f4e\u4e8e 1ms\u3002.<\/p><p>\u6253\u5f00 Redis \u914d\u7f6e\u6587\u4ef6 <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/redis\/redis.conf<\/code> \uff08\u6216 <code class=\"notranslate no-translate\" data-no-translation=\"\">\/etc\/redis.conf<\/code>) \u5e76\u6dfb\u52a0\u4e24\u4e2a\u5206\u914d\u53c2\u6570\uff1a<\/p><ul>\n<li><code class=\"notranslate no-translate\" data-no-translation=\"\">maxmemory 1024mb<\/code> \uff08\u4e3a Redis cache \u5206\u914d 1GB RAM\uff09<\/li>\n<li><code class=\"notranslate no-translate\" data-no-translation=\"\">maxmemory-policy allkeys-lru<\/code> \uff08\u5185\u5b58\u6ee1\u65f6\u81ea\u52a8\u5220\u9664\u6700\u65e7\u7684 key\uff09<\/li>\n<\/ul><p>\u91cd\u542f\u670d\u52a1\uff1a <code class=\"notranslate no-translate\" data-no-translation=\"\">systemctl restart redis<\/code>. \u7136\u540e\u5728 WordPress \u7ba1\u7406\u540e\u53f0\u5b89\u88c5\u63d2\u4ef6 <strong>LiteSpeed Cache<\/strong> \u2192 \u8fdb\u5165 <strong>[6] Object Cache<\/strong> \u2192 \u542f\u7528 <strong>ON<\/strong> \u2192 \u9009\u62e9\u534f\u8bae <strong>Redis<\/strong> \uff08Host\uff1a <code class=\"notranslate no-translate\" data-no-translation=\"\">127.0.0.1<\/code>, Port\uff1a <code class=\"notranslate no-translate\" data-no-translation=\"\">6379<\/code>).<\/p><h2>\u7b2c7\u5c42\uff1a\u4f18\u5316 WordPress \u5e94\u7528\u5c42<\/h2><p>\u5bfc\u81f4 WordPress CPU \u8d1f\u8f7d\u7a81\u7136\u98d9\u5347\u7684\u4e24\u4e2a\u9690\u6027\u5143\u51f6\u662f\u865a\u62df WP-Cron \u8fdb\u7a0b\u548c Heartbeat API \u673a\u5236\u3002.<\/p><h3>1. \u4f7f\u7528 Linux Crontab \u66ff\u4ee3\u865a\u62df WP-Cron\uff1a<\/h3><p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6bcf\u5f53\u6709\u8bbf\u5ba2\u8bbf\u95ee\u7f51\u7ad9\u65f6\uff0cWordPress \u90fd\u4f1a\u6fc0\u6d3b\u6587\u4ef6 <code class=\"notranslate no-translate\" data-no-translation=\"\">wp-cron.php<\/code>. \u5f53\u8bbf\u95ee\u91cf\u8f83\u5927\u65f6\uff0c\u6210\u5343\u4e0a\u4e07\u4e2a\u865a\u62df cron \u8fdb\u7a0b\u540c\u65f6\u8fd0\u884c\uff0c\u4f1a\u7acb\u5373\u5bfc\u81f4\u670d\u52a1\u5668\u8fc7\u8f7d\u3002.<\/p><p>\u6253\u5f00\u6587\u4ef6 <code class=\"notranslate no-translate\" data-no-translation=\"\">wp-config.php<\/code> \u5e76\u5728\u4ee5\u4e0b\u5185\u5bb9\u4e4b\u524d\u63d2\u5165\u4ee5\u4e0b\u4ee3\u7801 <code class=\"notranslate no-translate\" data-no-translation=\"\">\/* That's all, stop editing! *\/<\/code>:<\/p><p><code class=\"notranslate no-translate\" data-no-translation=\"\">define('DISABLE_WP_CRON', true);<\/code><\/p><p>\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6253\u5f00 Linux \u64cd\u4f5c\u7cfb\u7edf\u7684 crontab <code class=\"notranslate no-translate\" data-no-translation=\"\">crontab -e<\/code> \u5e76\u8bbe\u7f6e\u4e3a\u6bcf 10 \u5206\u949f\u8fd0\u884c\u4e00\u6b21\uff1a<\/p><p><code class=\"notranslate no-translate\" data-no-translation=\"\">*\/10 * * * * curl -s https:\/\/yourdomain.com\/wp-cron.php?doing_wp_cron > \/dev\/null 2>&1<\/code><\/p><h3>2. \u63a7\u5236 Heartbeat API\uff1a<\/h3><p>\u5728\u63d2\u4ef6 <strong>LiteSpeed Cache<\/strong> \u2192 \u9879\u76ee <strong>Toolbox \/ Heartbeat<\/strong>:<\/p><ul>\n<li><strong>Frontend Heartbeat\uff1a<\/strong> \u57df\u540d\u7ba1\u7406\u548c DNS \u914d\u7f6e\u662f\u6570\u5b57\u751f\u547d\u7ebf\u7684\u57fa\u7840\uff0c\u5e2e\u52a9\u4f01\u4e1a\u786e\u4fdd\u7a33\u5b9a\u4e14\u5b89\u5168\u7684\u5728\u7ebf\u5b58\u5728\u3002 <code class=\"notranslate no-translate\" data-no-translation=\"\">Disable<\/code> \u4ee5\u5728\u524d\u53f0\u9875\u9762\u5b8c\u5168\u5173\u95ed\u8be5\u529f\u80fd\u3002.<\/li>\n<li><strong>Backend &amp; Editor Heartbeat\uff1a<\/strong> \u5c06\u68c0\u67e5\u5468\u671f\u63d0\u9ad8\u5230 <code class=\"notranslate no-translate\" data-no-translation=\"\">60<\/code> \u6216\u8005 <code class=\"notranslate no-translate\" data-no-translation=\"\">120<\/code> \u79d2\u3002.<\/li>\n<\/ul><p>TranslatePress \u4f1a\u81ea\u52a8\u8df3\u8fc7\u6240\u6709\u4f4d\u4e8e\u5177\u6709\u6b64 class \u7684\u6807\u7b7e\u4e2d\u7684\u5185\u5bb9\u3002.<\/p><p><img decoding=\"async\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2026\/08\/toi_uu_hieu_suat_server_cyberp_img3_1787649930069.png\" alt=\"\u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316\" style=\"display:block;margin:20px auto;max-width:100%;height:auto\" title=\"\"><\/p><h2>\u90e8\u7f72\u540e\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u547d\u4ee4\u96c6<\/h2><p>\u5b8c\u6210\u5168\u90e8 7 \u5c42\u540e\uff0c\u8bf7\u5728 Terminal \u7a97\u53e3\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5e8f\u5217\uff0c\u4ee5\u9a8c\u8bc1\u6240\u6709\u53c2\u6570\u662f\u5426\u5df2\u6b63\u786e\u52a0\u8f7d\u5230\u7cfb\u7edf\u4e2d\uff1a<\/p><ul>\n<li><strong>\u68c0\u67e5 MariaDB RAM\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">mysql -e \"SHOW VARIABLES LIKE 'innodb_buffer_pool_size';\"<\/code><\/li>\n<li><strong>\u68c0\u67e5 OPcache \u4e0e JIT PHP 8.3\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">\/usr\/local\/lsws\/lsphp83\/bin\/php -i | grep -E \"opcache.enable|opcache.memory_consumption|opcache.jit\"<\/code><\/li>\n<li><strong>\u68c0\u67e5\u6587\u4ef6\u6253\u5f00\u9650\u5236\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">ulimit -n<\/code><\/li>\n<li><strong>\u68c0\u67e5 Kernel Sysctl\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">sysctl vm.swappiness net.core.somaxconn fs.file-max<\/code><\/li>\n<li><strong>\u5b9e\u65f6\u76d1\u63a7\u786c\u4ef6\uff1a<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">htop<\/code><\/li>\n<\/ul><p><img decoding=\"async\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2026\/08\/toi_uu_hieu_suat_server_cyberp_img3_1787649930069.png\" alt=\"\u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316\" style=\"display:block;margin:20px auto;max-width:100%;height:auto\" title=\"\"><\/p><h2>\u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316\u540e\u7684\u5b9e\u9645\u6548\u679c<\/h2><p>\u5728\u5b8c\u6210\u5168\u90e8 7 \u5c42\u8c03\u4f18\u540e\uff0c\u5bf9\u7535\u5546\u7cfb\u7edf\u8fdb\u884c\u5b9e\u9645\u6027\u80fd\u6d4b\u8bd5 <em>M\u1ed9c Gia\u5ba4\u5185\u8bbe\u8ba1<\/em> \u9996\u5c4f\u54cd\u5e94\u65f6\u95f4\uff08TTFB\uff09\u4ece <strong>920ms \u964d\u81f3 38ms<\/strong>, \u5e76\u53d1\u5904\u7406\u80fd\u529b\u4ece 220 \u4e2a\u8fde\u63a5\u63d0\u5347\u81f3\u8d85\u8fc7 <strong>3,100 \u4e2a\u540c\u65f6\u6d3b\u8dc3\u7528\u6237<\/strong> \u800c CPU \u4f7f\u7528\u7387\u59cb\u7ec8\u7a33\u5b9a\u4f4e\u4e8e 20%\u3002.<\/p><p>\u5982\u679c\u60a8\u7684\u4f01\u4e1a\u6b63\u9762\u4e34\u670d\u52a1\u5668\u8fc7\u8f7d\u3001\u7f51\u7ad9\u52a0\u8f7d\u7f13\u6162\uff0c\u6216\u9700\u8981\u4e3a\u5e7f\u544a\u6d3b\u52a8\u7206\u53d1\u671f\u6784\u5efa\u7a33\u5b9a\u7684\u6570\u5b57\u57fa\u7840\u8bbe\u65bd\uff0c\u8bf7\u53c2\u8003 <a href=\"https:\/\/dps.media\/zh\/\">DPS.MEDIA \u7684\u9ad8\u901f\u7f51\u7ad9\u8bbe\u8ba1\u4e0e VPS \u57fa\u7840\u8bbe\u65bd\u670d\u52a1<\/a> \u6216\u76f4\u63a5\u8054\u7cfb\u70ed\u7ebf\/Zalo <strong>0961545445<\/strong> \u4ee5\u83b7\u53d6\u6700\u8be6\u7ec6\u7684\u6280\u672f\u54a8\u8be2\u3002.<\/p>","protected":false},"excerpt":{"rendered":"<p>H\u01b0\u1edbng d\u1eabn t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server CyberPanel v\u00e0 OpenLiteSpeed chuy\u00ean s\u00e2u qua 7 t\u1ea7ng c\u1ea5u h\u00ecnh t\u1eeb Linux Kernel, MariaDB Buffer Pool, PHP JIT \u0111\u1ebfn Redis Cache.<\/p>","protected":false},"author":0,"featured_media":40371,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2388,2389,2390],"tags":[2272],"class_list":["post-40374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ha-tang-vps","category-kien-thuc-wordpress","category-toi-uu-hoa-website","tag-openlitespeed"],"acf":[],"rankmath_keywords":{"primary":"t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server, t\u1ed1i \u01b0u server CyberPanel, c\u1ea5u h\u00ecnh t\u1ed1i \u01b0u server, t\u1ed1i \u01b0u OpenLiteSpeed","secondary":["t\u1ed1i \u01b0u server CyberPanel","c\u1ea5u h\u00ecnh t\u1ed1i \u01b0u server","t\u1ed1i \u01b0u OpenLiteSpeed"]},"yoast_keywords":{"primary":"","secondary":[]},"yoast_focuskw":"","rankmath_focuskw":"t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server, t\u1ed1i \u01b0u server CyberPanel, c\u1ea5u h\u00ecnh t\u1ed1i \u01b0u server, t\u1ed1i \u01b0u OpenLiteSpeed","seo_keywords":{"primary":"t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server, t\u1ed1i \u01b0u server CyberPanel, c\u1ea5u h\u00ecnh t\u1ed1i \u01b0u server, t\u1ed1i \u01b0u OpenLiteSpeed","secondary":["t\u1ed1i \u01b0u server CyberPanel","c\u1ea5u h\u00ecnh t\u1ed1i \u01b0u server","t\u1ed1i \u01b0u OpenLiteSpeed"]},"_links":{"self":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts\/40374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/comments?post=40374"}],"version-history":[{"count":1,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts\/40374\/revisions"}],"predecessor-version":[{"id":40786,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts\/40374\/revisions\/40786"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/media\/40371"}],"wp:attachment":[{"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/media?parent=40374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/categories?post=40374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/tags?post=40374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}