{"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":"toi-uu-hieu-suat-server-cyberpanel","status":"publish","type":"post","link":"https:\/\/dps.media\/zh\/toi-uu-hieu-suat-server-cyberpanel\/","title":{"rendered":"T\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server CyberPanel: Playbook 7 t\u1ea7ng cho VPS t\u1ea3i cao"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>S\u1edf h\u1eefu m\u1ed9t c\u1ea5u h\u00ecnh m\u00e1y ch\u1ee7 8 Core CPU v\u00e0 16GB hay 32GB RAM nh\u01b0ng website WordPress v\u1eabn th\u01b0\u1eddng xuy\u00ean gi\u1eadt lag, CPU ch\u1ea1m ng\u01b0\u1ee1ng 100% ho\u1eb7c s\u1eadp ngu\u1ed3n khi c\u00f3 chi\u1ebfn d\u1ecbch qu\u1ea3ng c\u00e1o \u0111\u1ed5 v\u1ec1? V\u1ea5n \u0111\u1ec1 h\u1ea7u nh\u01b0 kh\u00f4ng n\u1eb1m \u1edf ph\u1ea7n c\u1ee9ng, m\u00e0 n\u1eb1m \u1edf vi\u1ec7c m\u00e1y ch\u1ee7 ch\u01b0a \u0111\u01b0\u1ee3c tinh ch\u1ec9nh chu\u1ea9n x\u00e1c. C\u1ea5u h\u00ecnh m\u1eb7c \u0111\u1ecbnh c\u1ee7a CyberPanel v\u00e0 h\u1ec7 \u0111i\u1ec1u h\u00e0nh Linux v\u1ed1n ch\u1ec9 \u0111\u01b0\u1ee3c thi\u1ebft l\u1eadp \u1edf m\u1ee9c an to\u00e0n t\u1ed1i thi\u1ec3u \u0111\u1ec3 c\u00f3 th\u1ec3 ch\u1ea1y \u0111\u01b0\u1ee3c tr\u00ean c\u00e1c g\u00f3i VPS 1GB RAM gi\u00e1 r\u1ebb.<\/p><p>\u0110\u1ec3 gi\u1ea3i ph\u00f3ng ho\u00e0n to\u00e0n s\u1ee9c m\u1ea1nh ph\u1ea7n c\u1ee9ng, quy tr\u00ecnh <a href=\"https:\/\/dps.media\/zh\/toi-uu-hieu-suat-server-cyberpanel\/\">t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server<\/a> \u0111\u00f2i h\u1ecfi ph\u1ea3i can thi\u1ec7p \u0111\u1ed3ng b\u1ed9 t\u1eeb t\u1ea7ng nh\u00e2n Linux (Kernel), gi\u1edbi h\u1ea1n ti\u1ebfn tr\u00ecnh h\u1ec7 th\u1ed1ng, c\u01a1 s\u1edf d\u1eef li\u1ec7u MariaDB, b\u1ed9 m\u00e1y th\u00f4ng d\u1ecbch PHP 8.x, m\u00e1y ch\u1ee7 web OpenLiteSpeed cho t\u1edbi b\u1ed9 nh\u1edb \u0111\u1ec7m Redis v\u00e0 \u1ee9ng d\u1ee5ng WordPress.<\/p><p>D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u1ea9m nang playbook 7 t\u1ea7ng tinh ch\u1ec9nh th\u1ef1c chi\u1ebfn \u0111\u01b0\u1ee3c \u0111\u1ed9i ng\u0169 k\u1ef9 thu\u1eadt DPS.MEDIA \u0111\u00fac k\u1ebft qua h\u00e0ng tr\u0103m d\u1ef1 \u00e1n tri\u1ec3n khai m\u00e1y ch\u1ee7 ch\u1ecbu t\u1ea3i cao cho c\u00e1c s\u00e0n th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed v\u00e0 h\u1ec7 sinh th\u00e1i \u0111a website.<\/p><p><img decoding=\"async\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2026\/08\/toi_uu_hieu_suat_server_cyberp_img2_1787649791044.png\" alt=\"t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server\" style=\"display:block; margin:20px auto; max-width:100%; height:auto;\" title=\"\"><\/p><h2>T\u1ea7ng 1: Tinh ch\u1ec9nh t\u1ea7ng nh\u00e2n Linux Kernel (\/etc\/sysctl.conf)<\/h2><p>T\u1ea7ng nh\u00e2n Linux l\u00e0 n\u01a1i \u0111i\u1ec1u ph\u1ed1i t\u00e0i nguy\u00ean ph\u1ea7n c\u1ee9ng v\u00e0 h\u00e0ng \u0111\u1ee3i m\u1ea1ng TCP. \u1ede c\u1ea5u h\u00ecnh m\u1eb7c \u0111\u1ecbnh, Linux r\u1ea5t d\u1ec5 \u0111\u1ea9y b\u1ed9 nh\u1edb \u0111\u1ec7m xu\u1ed1ng \u1ed5 c\u1ee9ng (Swap) ngay c\u1ea3 khi RAM v\u1eadt l\u00fd c\u00f2n d\u01b0 th\u1eeba, \u0111\u1ed3ng th\u1eddi gi\u1edbi h\u1ea1n s\u1ed1 l\u01b0\u1ee3ng k\u1ebft n\u1ed1i \u0111\u1ed3ng th\u1eddi \u1edf m\u1ee9c r\u1ea5t th\u1ea5p.<\/p><p>M\u1edf t\u1ec7p c\u1ea5u h\u00ecnh h\u1ec7 th\u1ed1ng b\u1eb1ng l\u1ec7nh: <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/sysctl.conf<\/code> v\u00e0 b\u1ed5 sung 4 nh\u00f3m tham s\u1ed1 c\u1ed1t l\u00f5i sau v\u00e0o cu\u1ed1i t\u1ec7p:<\/p><ul>\n<li><strong>1. T\u1ed1i \u01b0u b\u1ed9 nh\u1edb & Swap:<\/strong>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">vm.swappiness = 10<\/code> (Ch\u1ec9 d\u00f9ng Swap khi RAM th\u1ef1c s\u1ef1 c\u1ea1n d\u01b0\u1edbi 10%).<\/p>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">vm.vfs_cache_pressure = 50<\/code> (Gi\u1eef cache inode v\u00e0 th\u01b0 m\u1ee5c trong RAM l\u00e2u h\u01a1n).<\/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> (Ghi d\u1eef li\u1ec7u t\u1eeb RAM xu\u1ed1ng SSD m\u01b0\u1ee3t m\u00e0).\n  <\/p>\n<\/li>\n<li><strong>2. M\u1edf r\u1ed9ng File Descriptors h\u1ec7 th\u1ed1ng:<\/strong>\n<p>\u2022 <code class=\"notranslate no-translate\" data-no-translation=\"\">fs.file-max = 2097152<\/code> (Cho ph\u00e9p m\u1edf h\u01a1n 2 tri\u1ec7u t\u1ec7p \u0111\u1ed3ng th\u1eddi).<\/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. M\u1edf r\u1ed9ng h\u00e0ng \u0111\u1ee3i TCP & T\u00e1i s\u1eed d\u1ee5ng k\u1ebft n\u1ed1i:<\/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> (H\u00e0ng \u0111\u1ee3i socket t\u1ed1i \u0111a).<\/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> (Thu h\u1ed3i socket TIME_WAIT sau 15s).<\/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> (M\u1edf r\u1ed9ng d\u1ea3i port outbound).\n  <\/p>\n<\/li>\n<li><strong>4. T\u0103ng dung l\u01b0\u1ee3ng Buffer m\u1ea1ng:<\/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> (C\u1ea5p 16MB buffer).<\/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> (Ch\u1ed1ng tr\u00e0n h\u00e0ng \u0111\u1ee3i TCP SYN).\n  <\/p>\n<\/li>\n<\/ul><p>K\u00edch ho\u1ea1t ngay c\u1ea5u h\u00ecnh m\u1edbi m\u00e0 kh\u00f4ng c\u1ea7n kh\u1edfi \u0111\u1ed9ng l\u1ea1i m\u00e1y ch\u1ee7 b\u1eb1ng l\u1ec7nh:<\/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=\"t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server\" style=\"display:block; margin:20px auto; max-width:100%; height:auto;\" title=\"\"><\/p><h2>T\u1ea7ng 2: M\u1edf r\u1ed9ng gi\u1edbi h\u1ea1n t\u00e0i nguy\u00ean h\u1ec7 \u0111i\u1ec1u h\u00e0nh (\/etc\/security\/limits.conf)<\/h2><p>Hi\u1ec7n t\u01b0\u1ee3ng website \u0111\u1ed9t ng\u1ed9t tr\u1ea3 v\u1ec1 m\u00e3 l\u1ed7i 500 ho\u1eb7c 502 Bad Gateway khi l\u01b0\u1ee3ng truy c\u1eadp t\u0103ng v\u1ecdt th\u01b0\u1eddng xu\u1ea5t ph\u00e1t t\u1eeb vi\u1ec7c h\u1ec7 \u0111i\u1ec1u h\u00e0nh ch\u1ea1m tr\u1ea7n gi\u1edbi h\u1ea1n s\u1ed1 l\u01b0\u1ee3ng t\u1ec7p m\u1edf \u0111\u1ed3ng th\u1eddi (Too many open files). M\u1ed7i k\u1ebft n\u1ed1i ng\u01b0\u1eddi d\u00f9ng, t\u1ec7p \u1ea3nh, truy v\u1ea5n database hay ti\u1ebfn tr\u00ecnh PHP \u0111\u1ec1u ti\u00eau t\u1ed1n m\u1ed9t File Descriptor.<\/p><p>M\u1edf t\u1ec7p <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/security\/limits.conf<\/code> v\u00e0 th\u00eam c\u00e1c d\u00f2ng sau v\u00e0o tr\u01b0\u1edbc d\u00f2ng <code class=\"notranslate no-translate\" data-no-translation=\"\"># End of file<\/code> \u0111\u1ec3 m\u1edf kh\u00f3a gi\u1edbi h\u1ea1n cho ng\u01b0\u1eddi d\u00f9ng h\u1ec7 th\u1ed1ng (<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>Gi\u1edbi h\u1ea1n s\u1ed1 t\u1ec7p m\u1edf \u0111\u1ed3ng th\u1eddi (nofile):<\/strong> \u8bbe\u7f6e <code class=\"notranslate no-translate\" data-no-translation=\"\">soft nofile 65535<\/code> v\u00e0 <code class=\"notranslate no-translate\" data-no-translation=\"\">hard nofile 65535<\/code> cho to\u00e0n b\u1ed9 ti\u1ebfn tr\u00ecnh.<\/li>\n<li><strong>Gi\u1edbi h\u1ea1n s\u1ed1 ti\u1ebfn tr\u00ecnh \u0111\u1ed3ng th\u1eddi (nproc):<\/strong> \u8bbe\u7f6e <code class=\"notranslate no-translate\" data-no-translation=\"\">soft nproc 65535<\/code> v\u00e0 <code class=\"notranslate no-translate\" data-no-translation=\"\">hard nproc 65535<\/code>.<\/li>\n<li><strong>Kh\u00f3a b\u1ed9 nh\u1edb (memlock):<\/strong> \u8bbe\u7f6e <code class=\"notranslate no-translate\" data-no-translation=\"\">soft memlock unlimited<\/code> v\u00e0 <code class=\"notranslate no-translate\" data-no-translation=\"\">hard memlock unlimited<\/code>.<\/li>\n<\/ul><h2>T\u1ea7ng 3: T\u1ed1i \u01b0u c\u01a1 s\u1edf d\u1eef li\u1ec7u MariaDB tr\u00ean RAM (\/etc\/mysql\/mariadb.conf.d\/99-tuning.cnf)<\/h2><p>\u0110i\u1ec3m ngh\u1ebdn l\u1edbn nh\u1ea5t trong h\u1ea7u h\u1ebft website WordPress ch\u00ednh l\u00e0 t\u1ed1c \u0111\u1ed9 \u0111\u1ecdc ghi \u1ed5 c\u1ee9ng t\u1eeb Database. B\u1eb1ng c\u00e1ch g\u00e1n ph\u1ea7n l\u1edbn d\u1eef li\u1ec7u v\u00e0 ch\u1ec9 m\u1ee5c b\u1ea3ng v\u00e0o v\u00f9ng nh\u1edb RAM (InnoDB Buffer Pool), t\u1ed1c \u0111\u1ed9 ph\u1ea3n h\u1ed3i truy v\u1ea5n c\u00f3 th\u1ec3 t\u0103ng t\u1eeb 5 \u0111\u1ebfn 10 l\u1ea7n.<\/p><h3>C\u00f4ng th\u1ee9c ph\u00e2n b\u1ed5 RAM cho innodb_buffer_pool_size:<\/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;\">C\u1ea5u h\u00ecnh RAM v\u1eadt l\u00fd<\/th>\n<th style=\"border: 1px solid #ddd; padding: 10px;\">Dung l\u01b0\u1ee3ng c\u1ea5p cho Buffer Pool<\/th>\n<th style=\"border: 1px solid #ddd; padding: 10px;\">S\u1ed1 l\u01b0\u1ee3ng Instances<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border: 1px solid #ddd; padding: 10px;\">VPS 8GB RAM<\/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;\">Server 16GB RAM<\/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;\">Server 24GB \u2013 32GB RAM<\/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;\">Dedicated Server 64GB+ RAM<\/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>T\u1ea1o t\u1ec7p c\u1ea5u h\u00ecnh \u0111\u1ed9c l\u1eadp <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/mysql\/mariadb.conf.d\/99-tuning.cnf<\/code> v\u1edbi c\u00e1c th\u00f4ng s\u1ed1 t\u1ed1i \u01b0u:<\/p><ul>\n<li><strong>InnoDB Engine:<\/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>K\u1ebft n\u1ed1i & B\u1ed9 \u0111\u1ec7m truy v\u1ea5n:<\/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>Kh\u1edfi \u0111\u1ed9ng l\u1ea1i d\u1ecbch v\u1ee5 MariaDB v\u00e0 ki\u1ec3m tra dung l\u01b0\u1ee3ng RAM th\u1ef1c nh\u1eadn:<\/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>T\u1ea7ng 4: T\u1ed1i \u01b0u b\u1ed9 m\u00e1y PHP 8.x Engine v\u00e0 JIT Compiler (php.ini)<\/h2><p>PHP 8.2 v\u00e0 8.3 mang l\u1ea1i hi\u1ec7u n\u0103ng v\u01b0\u1ee3t tr\u1ed9i nh\u1edd ki\u1ebfn tr\u00fac JIT (Just-In-Time) Compiler. Tuy nhi\u00ean, n\u1ebfu kh\u00f4ng c\u1ea5p \u0111\u1ee7 b\u1ed9 nh\u1edb cho OPcache l\u01b0u tr\u1eef m\u00e3 bytecode \u0111\u00e3 bi\u00ean d\u1ecbch, PHP s\u1ebd li\u00ean t\u1ee5c ph\u1ea3i \u0111\u1ecdc m\u00e3 ngu\u1ed3n t\u1eeb \u0111\u0129a, l\u00e0m l\u00e3ng ph\u00ed chu k\u1ef3 x\u1eed l\u00fd c\u1ee7a CPU.<\/p><p>Tr\u00ean giao di\u1ec7n CyberPanel, truy c\u1eadp <strong>PHP<\/strong> \u2192 <strong>Edit PHP Configs<\/strong> \u2192 tab <strong>\u9ad8\u7ea7<\/strong> (ho\u1eb7c ch\u1ec9nh s\u1eeda t\u1ec7p <code class=\"notranslate no-translate\" data-no-translation=\"\">\/usr\/local\/lsws\/lsphp83\/etc\/php.ini<\/code>):<\/p><ul>\n<li><strong>B\u1ed9 nh\u1edb & Gi\u1edbi h\u1ea1n t\u1ec7p:<\/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>T\u1ed1i \u01b0u \u0111\u01b0\u1eddng d\u1eabn:<\/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>T\u1eaft th\u1ed1ng k\u00ea th\u1eeba:<\/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>K\u00edch ho\u1ea1t OPcache:<\/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>K\u00edch ho\u1ea1t PHP 8.x JIT Compiler:<\/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> (T\u0103ng t\u1ed1c t\u00ednh to\u00e1n ph\u00e9p t\u00ednh CPU).<\/li>\n<\/ul><h2>T\u1ea7ng 5: Tinh ch\u1ec9nh m\u00e1y ch\u1ee7 Web OpenLiteSpeed (OLS WebAdmin)<\/h2><p>OpenLiteSpeed s\u1eed d\u1ee5ng m\u00f4 h\u00ecnh Event-Driven b\u1ea5t \u0111\u1ed3ng b\u1ed9 c\u00f3 kh\u1ea3 n\u0103ng ph\u1ee5c v\u1ee5 h\u00e0ng ch\u1ee5c ngh\u00ecn k\u1ebft n\u1ed1i m\u00e0 kh\u00f4ng l\u00e0m tr\u00e0n b\u1ed9 nh\u1edb. Theo <a href=\"https:\/\/docs.openlitespeed.org\/\" target=\"_blank\" rel=\"noopener nofollow\">t\u00e0i li\u1ec7u k\u1ef9 thu\u1eadt OpenLiteSpeed<\/a>, vi\u1ec7c thi\u1ebft l\u1eadp \u0111\u00fang s\u1ed1 l\u01b0\u1ee3ng ti\u1ebfn tr\u00ecnh Worker v\u00e0 k\u00edch ho\u1ea1t thu\u1eadt to\u00e1n n\u00e9n Brotli gi\u00fap gi\u1ea3m k\u00edch th\u01b0\u1edbc g\u00f3i tin truy\u1ec1n t\u1ea3i t\u1edbi 25% so v\u1edbi GZIP truy\u1ec1n th\u1ed1ng.<\/p><p>\u767b\u5f55\u5230 <strong>OpenLiteSpeed WebAdmin<\/strong> t\u1ea1i c\u1ed5ng <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>) v\u00e0 th\u1ef1c hi\u1ec7n hai nh\u00f3m thi\u1ebft l\u1eadp:<\/p><h3>1. Tinh ch\u1ec9nh External Application (lsphp):<\/h3><p>\u8fdb\u5165 <strong>Server Configuration<\/strong> \u2192 <strong>External App<\/strong> \u2192 ch\u1ecdn s\u1eeda <strong>lsphp<\/strong>:<\/p><ul>\n<li><strong>Max Connections:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">150<\/code> (ho\u1eb7c <code class=\"notranslate no-translate\" data-no-translation=\"\">200<\/code> v\u1edbi m\u00e1y ch\u1ee7 16 core)<\/li>\n<li><strong>Initial Request Timeout:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">60<\/code> | <strong>Retry Timeout:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">0<\/code><\/li>\n<li><strong>Persistent Connection:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">Yes<\/code> | <strong>Response Buffering:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">No<\/code><\/li>\n<li><strong>Environment:<\/strong> Th\u00eam hai d\u00f2ng bi\u1ebfn m\u00f4i tr\u01b0\u1eddng:\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:<\/strong> \u586b\u5199 <code class=\"notranslate no-translate\" data-no-translation=\"\">0<\/code> | <strong>Process Limit:<\/strong> \u586b\u5199 <code class=\"notranslate no-translate\" data-no-translation=\"\">1000<\/code> (ho\u1eb7c <code class=\"notranslate no-translate\" data-no-translation=\"\">0<\/code>)<\/li>\n<\/ul><h3>2. B\u1eadt n\u00e9n Brotli v\u00e0 Async SSL:<\/h3><p>\u8fdb\u5165 <strong>Server Configuration<\/strong> \u2192 tab <strong>Tuning<\/strong>:<\/p><ul>\n<li><strong>Max Connections:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">10000<\/code><\/li>\n<li><strong>Enable Async OpenSSL:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">Yes<\/code><\/li>\n<li><strong>Enable GZIP \/ Brotli Compression:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">Yes<\/code><\/li>\n<li><strong>Brotli Compression Level:<\/strong> \u0110\u1eb7t m\u1ee9c <code class=\"notranslate no-translate\" data-no-translation=\"\">4<\/code> (\u0111\u1ea1t t\u1ef7 l\u1ec7 n\u00e9n t\u1ed1i \u01b0u nh\u1ea5t m\u00e0 kh\u00f4ng g\u00e2y ngh\u1ebdn CPU).<\/li>\n<\/ul><p>Nh\u1ea5p v\u00e0o bi\u1ec3u t\u01b0\u1ee3ng v\u00f2ng tr\u00f2n xanh l\u00e1 c\u00e2y <strong>Graceful Restart<\/strong> \u1edf g\u00f3c tr\u00ean b\u00ean ph\u1ea3i \u0111\u1ec3 n\u1ea1p c\u1ea5u h\u00ecnh m\u1edbi.<\/p><h2>T\u1ea7ng 6: Tri\u1ec3n khai b\u1ed9 nh\u1edb \u0111\u1ec7m Redis Object Cache<\/h2><p>WordPress c\u00f3 c\u01a1 ch\u1ebf g\u1ecdi h\u00e0ng tr\u0103m c\u00e2u truy v\u1ea5n l\u1eb7p l\u1ea1i trong m\u1ed7i l\u01b0\u1ee3t t\u1ea3i trang. Thay v\u00ec b\u1eaft c\u01a1 s\u1edf d\u1eef li\u1ec7u x\u1eed l\u00fd c\u00f9ng m\u1ed9t truy v\u1ea5n nhi\u1ec1u l\u1ea7n, Redis Object Cache s\u1ebd l\u01b0u tr\u1eef k\u1ebft qu\u1ea3 n\u00e0y tr\u1ef1c ti\u1ebfp trong RAM v\u1edbi \u0111\u1ed9 tr\u1ec5 ph\u1ea3n h\u1ed3i d\u01b0\u1edbi 1ms.<\/p><p>M\u1edf t\u1ec7p c\u1ea5u h\u00ecnh Redis <code class=\"notranslate no-translate\" data-no-translation=\"\">nano \/etc\/redis\/redis.conf<\/code> (ho\u1eb7c <code class=\"notranslate no-translate\" data-no-translation=\"\">\/etc\/redis.conf<\/code>) v\u00e0 th\u00eam hai tham s\u1ed1 c\u1ea5p ph\u00e1t:<\/p><ul>\n<li><code class=\"notranslate no-translate\" data-no-translation=\"\">maxmemory 1024mb<\/code> (C\u1ea5p 1GB RAM cho Redis cache)<\/li>\n<li><code class=\"notranslate no-translate\" data-no-translation=\"\">maxmemory-policy allkeys-lru<\/code> (T\u1ef1 \u0111\u1ed9ng x\u00f3a key c\u0169 nh\u1ea5t khi \u0111\u1ea7y b\u1ed9 nh\u1edb)<\/li>\n<\/ul><p>Kh\u1edfi \u0111\u1ed9ng l\u1ea1i d\u1ecbch v\u1ee5: <code class=\"notranslate no-translate\" data-no-translation=\"\">systemctl restart redis<\/code>. Sau \u0111\u00f3, tr\u00ean trang qu\u1ea3n tr\u1ecb WordPress, c\u00e0i \u0111\u1eb7t plugin <strong>LiteSpeed Cache<\/strong> \u2192 chuy\u1ec3n \u0111\u1ebfn <strong>[6] Object Cache<\/strong> \u2192 B\u1eadt <strong>ON<\/strong> \u2192 ch\u1ecdn giao th\u1ee9c <strong>Redis<\/strong> (Host: <code class=\"notranslate no-translate\" data-no-translation=\"\">127.0.0.1<\/code>, Port: <code class=\"notranslate no-translate\" data-no-translation=\"\">6379<\/code>).<\/p><h2>T\u1ea7ng 7: T\u1ed1i \u01b0u h\u00f3a t\u1ea7ng \u1ee9ng d\u1ee5ng WordPress<\/h2><p>Hai th\u1ee7 ph\u1ea1m ng\u1ea7m g\u00e2y t\u0103ng \u0111\u1ed9t bi\u1ebfn t\u1ea3i CPU tr\u00ean WordPress l\u00e0 ti\u1ebfn tr\u00ecnh WP-Cron \u1ea3o v\u00e0 c\u01a1 ch\u1ebf Heartbeat API.<\/p><h3>1. Thay th\u1ebf WP-Cron \u1ea3o b\u1eb1ng Linux Crontab:<\/h3><p>M\u1eb7c \u0111\u1ecbnh, m\u1ed7i khi c\u00f3 kh\u00e1ch truy c\u1eadp v\u00e0o web, WordPress s\u1ebd k\u00edch ho\u1ea1t t\u1ec7p <code class=\"notranslate no-translate\" data-no-translation=\"\">wp-cron.php<\/code>. Khi l\u01b0\u1ee3ng truy c\u1eadp l\u1edbn, h\u00e0ng ngh\u00ecn ti\u1ebfn tr\u00ecnh cron \u1ea3o ch\u1ea1y \u0111\u1ed3ng th\u1eddi s\u1ebd khi\u1ebfn m\u00e1y ch\u1ee7 qu\u00e1 t\u1ea3i ngay l\u1eadp t\u1ee9c.<\/p><p>M\u1edf t\u1ec7p <code class=\"notranslate no-translate\" data-no-translation=\"\">wp-config.php<\/code> v\u00e0 ch\u00e8n d\u00f2ng sau tr\u01b0\u1edbc <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>Sau \u0111\u00f3 m\u1edf crontab c\u1ee7a h\u1ec7 \u0111i\u1ec1u h\u00e0nh Linux b\u1eb1ng l\u1ec7nh <code class=\"notranslate no-translate\" data-no-translation=\"\">crontab -e<\/code> v\u00e0 \u0111\u1eb7t l\u1ecbch ch\u1ea1y 10 ph\u00fat m\u1ed9t l\u1ea7n:<\/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. Ki\u1ec3m so\u00e1t Heartbeat API:<\/h3><p>Trong plugin <strong>LiteSpeed Cache<\/strong> \u2192 m\u1ee5c <strong>Toolbox \/ Heartbeat<\/strong>:<\/p><ul>\n<li><strong>Frontend Heartbeat:<\/strong> \u9009\u62e9 <code class=\"notranslate no-translate\" data-no-translation=\"\">Disable<\/code> \u0111\u1ec3 t\u1eaft ho\u00e0n to\u00e0n \u1edf ngo\u00e0i trang ch\u1ee7.<\/li>\n<li><strong>Backend & Editor Heartbeat:<\/strong> T\u0103ng chu k\u1ef3 ki\u1ec3m tra l\u00ean <code class=\"notranslate no-translate\" data-no-translation=\"\">60<\/code> ho\u1eb7c <code class=\"notranslate no-translate\" data-no-translation=\"\">120<\/code> gi\u00e2y.<\/li>\n<\/ul><p>TranslatePress s\u1ebd t\u1ef1 \u0111\u1ed9ng b\u1ecf qua to\u00e0n b\u1ed9 n\u1ed9i dung n\u1eb1m trong c\u00e1c th\u1ebb c\u00f3 class n\u00e0y.<\/p><p><img decoding=\"async\" src=\"https:\/\/dps.media\/wp-content\/uploads\/2026\/08\/toi_uu_hieu_suat_server_cyberp_img3_1787649930069.png\" alt=\"t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server\" style=\"display:block; margin:20px auto; max-width:100%; height:auto;\" title=\"\"><\/p><h2>B\u1ed9 l\u1ec7nh ki\u1ec3m tra s\u1ee9c kh\u1ecfe m\u00e1y ch\u1ee7 sau khi tri\u1ec3n khai<\/h2><p>Sau khi ho\u00e0n t\u1ea5t c\u1ea3 7 t\u1ea7ng, h\u00e3y ch\u1ea1y chu\u1ed7i l\u1ec7nh sau trong c\u1eeda s\u1ed5 Terminal \u0111\u1ec3 ki\u1ec3m ch\u1ee9ng to\u00e0n b\u1ed9 th\u00f4ng s\u1ed1 \u0111\u00e3 \u0111\u01b0\u1ee3c n\u1ea1p ch\u00ednh x\u00e1c v\u00e0o h\u1ec7 th\u1ed1ng:<\/p><ul>\n<li><strong>Ki\u1ec3m tra RAM MariaDB:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">mysql -e \"SHOW VARIABLES LIKE 'innodb_buffer_pool_size';\"<\/code><\/li>\n<li><strong>Ki\u1ec3m tra OPcache & JIT PHP 8.3:<\/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>Ki\u1ec3m tra gi\u1edbi h\u1ea1n m\u1edf t\u1ec7p:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">ulimit -n<\/code><\/li>\n<li><strong>Ki\u1ec3m tra Kernel Sysctl:<\/strong> <code class=\"notranslate no-translate\" data-no-translation=\"\">sysctl vm.swappiness net.core.somaxconn fs.file-max<\/code><\/li>\n<li><strong>Gi\u00e1m s\u00e1t ph\u1ea7n c\u1ee9ng realtime:<\/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=\"t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server\" style=\"display:block; margin:20px auto; max-width:100%; height:auto;\" title=\"\"><\/p><h2>K\u1ebft qu\u1ea3 th\u1ef1c t\u1ebf sau khi t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t server<\/h2><p>\u0110o ki\u1ec3m hi\u1ec7u n\u0103ng th\u1ef1c t\u1ebf t\u1ea1i h\u1ec7 th\u1ed1ng th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed <em>N\u1ed9i th\u1ea5t M\u1ed9c Gia<\/em> sau khi ho\u00e0n th\u00e0nh to\u00e0n b\u1ed9 7 t\u1ea7ng tinh ch\u1ec9nh: Th\u1eddi gian ph\u1ea3n h\u1ed3i trang \u0111\u1ea7u ti\u00ean (TTFB) gi\u1ea3m s\u00e2u t\u1eeb <strong>920ms xu\u1ed1ng c\u00f2n 38ms<\/strong>, kh\u1ea3 n\u0103ng x\u1eed l\u00fd \u0111\u1ed3ng th\u1eddi t\u0103ng t\u1eeb 220 k\u1ebft n\u1ed1i l\u00ean h\u01a1n <strong>3.100 ng\u01b0\u1eddi d\u00f9ng ho\u1ea1t \u0111\u1ed9ng c\u00f9ng l\u00fac<\/strong> m\u00e0 m\u1ee9c ti\u00eau th\u1ee5 CPU lu\u00f4n \u1ed5n \u0111\u1ecbnh d\u01b0\u1edbi 20%.<\/p><p>N\u1ebfu doanh nghi\u1ec7p c\u1ee7a b\u1ea1n \u0111ang g\u1eb7p kh\u00f3 kh\u0103n v\u1edbi t\u00ecnh tr\u1ea1ng m\u00e1y ch\u1ee7 qu\u00e1 t\u1ea3i, website t\u1ea3i ch\u1eadm ho\u1eb7c c\u1ea7n x\u00e2y d\u1ef1ng h\u1ea1 t\u1ea7ng s\u1ed1 \u1ed5n \u0111\u1ecbnh cho c\u00e1c \u0111\u1ee3t b\u00f9ng n\u1ed5 chi\u1ebfn d\u1ecbch qu\u1ea3ng c\u00e1o, h\u00e3y tham kh\u1ea3o <a href=\"https:\/\/dps.media\/zh\/\">d\u1ecbch v\u1ee5 thi\u1ebft k\u1ebf website v\u00e0 h\u1ea1 t\u1ea7ng VPS t\u1ed1c \u0111\u1ed9 cao t\u1ea1i DPS.MEDIA<\/a> ho\u1eb7c li\u00ean h\u1ec7 tr\u1ef1c ti\u1ebfp hotline\/Zalo <strong>0961545445<\/strong> \u0111\u1ec3 nh\u1eadn t\u01b0 v\u1ea5n k\u1ef9 thu\u1eadt chi ti\u1ebft nh\u1ea5t.<\/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":0,"href":"https:\/\/dps.media\/zh\/wp-json\/wp\/v2\/posts\/40374\/revisions"}],"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}]}}