{"id":3311,"date":"2026-02-15T08:00:00","date_gmt":"2026-02-15T11:00:00","guid":{"rendered":"https:\/\/helpsysadmin.com.br\/blog\/?p=3311"},"modified":"2026-04-20T15:12:55","modified_gmt":"2026-04-20T18:12:55","slug":"otimizar-mariadb-my-cnf-producao","status":"publish","type":"post","link":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/","title":{"rendered":"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o"},"content":{"rendered":"<div id=\"helps-1456654971\" class=\"helps-before-content-2 helps-entity-placement\"><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-3661896953164277\"\r\n     crossorigin=\"anonymous\"><\/script>\r\n<!-- 2anuncios display quadrado -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-3661896953164277\"\r\n     data-ad-slot=\"5051229894\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script><\/div>\n<p class=\"wp-block-paragraph\">&#8220;Voc\u00ea sabia que um banco de dados mal configurado \u00e9 a principal causa de TTFB (Time to First Byte) alto em sites <strong><a href=\"https:\/\/br.wordpress.org\/\">WordPress<\/a><\/strong>? Otimizar o <code>my.cnf<\/code> n\u00e3o s\u00f3 baixa o Load do seu servidor, como ajuda diretamente no SEO dos sites hospedados, fazendo o Google ranquear melhor o conte\u00fado dos seus clientes.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Otimizar <strong><a href=\"https:\/\/mariadb.org\/\">MariaDB<\/a><\/strong>. A configura\u00e7\u00e3o padr\u00e3o do MariaDB \u00e9 feita para funcionar em qualquer torradeira, n\u00e3o para performar no seu servidor dedicado ou VPS de produ\u00e7\u00e3o. Se o seu site WordPress est\u00e1 lento ou o servidor est\u00e1 com <em>Load<\/em> alto devido ao MySQL, geralmente o problema n\u00e3o \u00e9 falta de hardware, mas um <code>my.cnf<\/code> mal configurado.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Aqui est\u00e1 o que voc\u00ea precisa ajustar agora.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-passo-0-a-regra-de-ouro-do-sysadmin\">\u26a0\ufe0f Passo 0: A Regra de Ouro do SysAdmin<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Antes de tocar em qualquer coisa:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cp \/etc\/my.cnf \/etc\/my.cnf.bak.$(date +%F)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">cp<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">etc<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">my<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">cnf<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">etc<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">my<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">cnf<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">bak<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">$<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">date<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">+%<\/span><span style=\"color: #D8DEE9\">F<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<p class=\"wp-block-paragraph\">Se o MariaDB n\u00e3o subir, voc\u00ea tem um backup instant\u00e2neo.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-o-coracao-innodb-buffer-pool-size\">1. O Cora\u00e7\u00e3o: <code>innodb_buffer_pool_size<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Esta \u00e9 a vari\u00e1vel mais importante de todas. O MariaDB usa o buffer pool para manter dados e \u00edndices em cache na mem\u00f3ria RAM, evitando leitura em disco (I\/O).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Servidor Dedicado apenas para Banco:<\/strong> Configure entre <strong>70% a 80%<\/strong> da RAM total.<\/li>\n\n\n\n<li><strong>Servidor Web Compartilhado (cPanel\/DirectAdmin):<\/strong> O banco concorre com o Apache\/Nginx\/PHP. Configure entre <strong>50% a 60%<\/strong> da RAM total.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Exemplo (Para um servidor de 16GB com web + banco):<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#91;mysqld&#93;\ninnodb_buffer_pool_size = 8G<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">&#91;<\/span><span style=\"color: #D8DEE9\">mysqld<\/span><span style=\"color: #D8DEE9FF\">&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">innodb_buffer_pool_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 8<\/span><span style=\"color: #D8DEE9\">G<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<p class=\"wp-block-paragraph\"><em>Dica: Se o valor for muito alto em um VPS pequeno, o OOM Killer do <a href=\"https:\/\/helpsysadmin.com.br\/blog\/como-instalar-crowdsec\/\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Como instalar Crowdsec\" target=\"_blank\" rel=\"noopener\">Linux<\/a> vai matar o MariaDB.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-a-performance-de-escrita-innodb-log-file-size\">2. A Performance de Escrita: <code>innodb_log_file_size<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Isso controla o tamanho dos logs de &#8220;redo&#8221; (transa\u00e7\u00f5es). Um valor muito baixo faz o MariaDB escrever no disco com muita frequ\u00eancia (checkpoints), matando a performance de escrita.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Recomenda\u00e7\u00e3o:<\/strong> 25% do tamanho do seu <code>innodb_buffer_pool_size<\/code>, mas geralmente <strong>512M<\/strong> a <strong>2G<\/strong> \u00e9 suficiente para a maioria das cargas de trabalho web.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>innodb_log_file_size = 512M<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">innodb_log_file_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 512<\/span><span style=\"color: #D8DEE9\">M<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-a-armadilha-do-cache-query-cache-type\">3. A Armadilha do Cache: <code>query_cache_type<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Desative isso.<\/strong> Em vers\u00f5es modernas do MariaDB e em ambientes com muitas escritas (como WordPress ou E-commerce), o <em>Query Cache<\/em> tradicional se torna um gargalo devido ao bloqueio global (global lock) que ele exige a cada atualiza\u00e7\u00e3o de tabela.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>query_cache_type = 0\nquery_cache_size = 0<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">query_cache_type<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">query_cache_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<p class=\"wp-block-paragraph\"><em>Nota: Confie no cache do InnoDB (Buffer Pool) e em caches de aplica\u00e7\u00e3o como Redis\/Object Cache.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-conexoes-e-temporarios\">4. Conex\u00f5es e Tempor\u00e1rios<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Dois ajustes finos para evitar erros de &#8220;Too many connections&#8221; e uso excessivo de disco para tabelas tempor\u00e1rias.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>max_connections<\/code>:<\/strong> N\u00e3o chute &#8220;10000&#8221;. Cada conex\u00e3o consome RAM. Para um servidor m\u00e9dio, <strong>150 a 300<\/strong> \u00e9 o suficiente.<\/li>\n\n\n\n<li><strong><code>tmp_table_size<\/code> e <code>max_heap_table_size<\/code>:<\/strong> Devem ter o mesmo valor. Isso define o tamanho m\u00e1ximo de uma tabela tempor\u00e1ria em mem\u00f3ria antes de ser jogada para o disco (o que \u00e9 lento).<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>max_connections = 200\ntmp_table_size = 64M\nmax_heap_table_size = 64M<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">max_connections<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">200<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">tmp_table_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 64<\/span><span style=\"color: #D8DEE9\">M<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">max_heap_table_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 64<\/span><span style=\"color: #D8DEE9\">M<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-resumo-do-my-cnf-copy-amp-paste\">Resumo do <code>my.cnf<\/code> (Copy &amp; Paste)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Ajuste o Buffer Pool conforme sua RAM.<\/em><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#91;mysqld&#93;\n# --- InnoDB Performance ---\n# Ajuste para 50-60% da RAM (Servidor Web) ou 80% (Banco Dedicado)\ninnodb_buffer_pool_size = 4G \ninnodb_log_file_size = 512M\ninnodb_file_per_table = 1\ninnodb_flush_log_at_trx_commit = 2 # Mais performance, risco m\u00ednimo de perda em crash total\n# --- Conex\u00f5es e Limites ---\nmax_connections = 200\nmax_allowed_packet = 64M\nopen_files_limit = 65535\n# --- Cache e Tempor\u00e1rios ---\n# Desativando Query Cache (Obsoleto\/Gargalo)\nquery_cache_type = 0\nquery_cache_size = 0\n# Tabelas Tempor\u00e1rias\ntmp_table_size = 64M\nmax_heap_table_size = 64M\n# --- Otimiza\u00e7\u00f5es Gerais ---\nthread_cache_size = 50\ntable_open_cache = 4000<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">&#91;<\/span><span style=\"color: #D8DEE9\">mysqld<\/span><span style=\"color: #D8DEE9FF\">&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #81A1C1\">---<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">InnoDB<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Performance<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Ajuste<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">para<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">50<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">60<\/span><span style=\"color: #81A1C1\">%<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">da<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">RAM<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #D8DEE9\">Servidor<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Web<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #D8DEE9\">ou<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">80<\/span><span style=\"color: #81A1C1\">%<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #D8DEE9\">Banco<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Dedicado<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">innodb_buffer_pool_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 4<\/span><span style=\"color: #D8DEE9\">G<\/span><span style=\"color: #D8DEE9FF\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">innodb_log_file_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 512<\/span><span style=\"color: #D8DEE9\">M<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">innodb_file_per_table<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">innodb_flush_log_at_trx_commit<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\"> # <\/span><span style=\"color: #D8DEE9\">Mais<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">performance<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">risco<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">m\u00ednimo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">de<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">perda<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">em<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">crash<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">total<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #81A1C1\">---<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Conex\u00f5es<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">e<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Limites<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">max_connections<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">200<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">max_allowed_packet<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 64<\/span><span style=\"color: #D8DEE9\">M<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">open_files_limit<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">65535<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #81A1C1\">---<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Cache<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">e<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Tempor\u00e1rios<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Desativando<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Query<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">Cache<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><span style=\"color: #D8DEE9\">Obsoleto<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">Gargalo<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">query_cache_type<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">query_cache_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #D8DEE9\">Tabelas<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Tempor\u00e1rias<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">tmp_table_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 64<\/span><span style=\"color: #D8DEE9\">M<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">max_heap_table_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> 64<\/span><span style=\"color: #D8DEE9\">M<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #81A1C1\">---<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Otimiza\u00e7\u00f5es<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Gerais<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">thread_cache_size<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">50<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">table_open_cache<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">4000<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-passo-final-aplicar-e-monitorar\">Passo Final: Aplicar e Monitorar<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Reinicie o servi\u00e7o e acompanhe o log de erros para garantir que tudo subiu corretamente:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>systemctl restart mariadb\ntail -f \/var\/log\/mysqld.log # ou \/var\/log\/messages<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">systemctl<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">restart<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">mariadb<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">tail<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">f<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/var<\/span><span style=\"color: #D8DEE9FF\">\/<\/span><span style=\"color: #D8DEE9\">log<\/span><span style=\"color: #D8DEE9FF\">\/mysqld.log # ou \/var\/log\/messages<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-quer-ir-alem-dos-5-minutos-use-o-mysqltuner\">Quer ir al\u00e9m dos 5 minutos? Use o MySQLTuner<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Depois que o servidor estiver rodando por pelo menos 24 horas com essas configura\u00e7\u00f5es, rode o script perl <strong>MySQLTuner<\/strong>. Ele vai analisar o uso real e sugerir ajustes finos baseados no tr\u00e1fego que o seu servidor recebeu.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>wget http:\/\/mysqltuner.pl\/ -O mysqltuner.pl\nperl mysqltuner.pl<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">wget<\/span><span style=\"color: #D8DEE9FF\"> http<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #616E88\">\/\/mysqltuner.pl\/ -O mysqltuner.pl<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">perl<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">mysqltuner<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">pl<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-dica-pro-seo-amp-performance\">Dica Pro (SEO &amp; Performance)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Um banco lento aumenta o TTFB (Time to First Byte). O Google odeia TTFB alto. Otimizar o <code>innodb_buffer_pool_size<\/code> \u00e9 frequentemente a maneira mais r\u00e1pida de baixar o TTFB de 1.5s para 200ms em sites din\u00e2micos.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-faq\">FAQ<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1770771720808\"><strong class=\"schema-faq-question\">Onde fica o arquivo de configura\u00e7\u00e3o my.cnf no Linux?<\/strong> <p class=\"schema-faq-answer\">Na maioria das distribui\u00e7\u00f5es Linux (CentOS, AlmaLinux, Ubuntu), o arquivo principal de configura\u00e7\u00e3o do MariaDB est\u00e1 localizado em <code>\/etc\/my.cnf<\/code> ou dentro do diret\u00f3rio <code>\/etc\/mysql\/<\/code>. Sempre fa\u00e7a um backup antes de editar.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1770771759681\"><strong class=\"schema-faq-question\">Qual o valor ideal para o innodb_buffer_pool_size?<\/strong> <p class=\"schema-faq-answer\">Em um servidor dedicado apenas para banco de dados, recomenda-se alocar entre 70% a 80% da mem\u00f3ria RAM total. Se o servidor for compartilhado (Web + Banco, como cPanel ou DirectAdmin), utilize entre 50% a 60% da RAM para evitar falta de mem\u00f3ria para o Apache\/Nginx.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1770771790894\"><strong class=\"schema-faq-question\">Preciso reiniciar o MariaDB ap\u00f3s alterar o my.cnf?<\/strong> <p class=\"schema-faq-answer\">Sim. A maioria das altera\u00e7\u00f5es no arquivo <code>my.cnf<\/code>, especialmente as relacionadas ao tamanho de buffers e mem\u00f3ria (como o <code>innodb_buffer_pool_size<\/code>), exige um rein\u00edcio do servi\u00e7o (<code>systemctl restart mariadb<\/code>) para entrar em vigor.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1770771801934\"><strong class=\"schema-faq-question\">O MySQLTuner \u00e9 seguro para usar em produ\u00e7\u00e3o?<\/strong> <p class=\"schema-faq-answer\">O MySQLTuner \u00e9 um script de leitura segura que n\u00e3o altera configura\u00e7\u00f5es sozinho; ele apenas sugere mudan\u00e7as. \u00c9 uma ferramenta excelente para diagn\u00f3stico, mas deve ser rodada ap\u00f3s o banco estar ativo por pelo menos 24 horas para gerar dados confi\u00e1veis.<\/p> <\/div> <\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-veja-mais\"><strong>Veja Mais:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/helpsysadmin.com.br\/blog\/otimizacao-de-perfomance-do-mariadb\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Guia completo para otimiza\u00e7\u00e3o de perfomance do mariadb<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/helpsysadmin.com.br\/blog\/como-instalar-openlitespeed-no-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Como Instalar Openlitespeed no Ubuntu 20.04<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/helpsysadmin.com.br\/blog\/diagnostico-linux-htop-iotop-glances\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Como Usar htop, iotop e Glances para Diagn\u00f3stico R\u00e1pido de Servidores Linux<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/helpsysadmin.com.br\/blog\/como-reduzir-o-tempo-de-resposta-ttfb-do-servidor\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Como reduzir o tempo de resposta (TTFB) do servidor<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/helpsysadmin.com.br\/blog\/cache-servidor-vs-cache-plugin\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Cache de servidor vs cache de plugin: diferen\u00e7as reais<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Voc\u00ea sabia que um banco de dados mal configurado \u00e9 a principal causa de TTFB (Time to First Byte) alto em sites [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":3312,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4189],"tags":[3427,13,29,3425,437,82,3429,2310],"class_list":["post-3311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-performance-e-otimizacao","tag-database-optimization","tag-linux","tag-mariadb","tag-my-cnf","tag-mysql","tag-performance","tag-sql-tuning","tag-sysadmin"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.9 (Yoast SEO v27.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o<\/title>\n<meta name=\"description\" content=\"Servidor lento? Aprenda a otimizar o MariaDB em produ\u00e7\u00e3o editando o my.cnf. Reduza o Load e o TTFB com as configura\u00e7\u00f5es ideais de buffer e cache.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o\" \/>\n<meta property=\"og:description\" content=\"Servidor lento? Aprenda a otimizar o MariaDB em produ\u00e7\u00e3o editando o my.cnf. Reduza o Load e o TTFB com as configura\u00e7\u00f5es ideais de buffer e cache.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog HelpSysAdmin\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-15T11:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-20T18:12:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mlkpd8g42nae.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2026\/02\/MySQL-Performance-Tuning.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"620\" \/>\n\t<meta property=\"og:image:height\" content=\"297\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"HelpSysAdmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brhelpsysad\" \/>\n<meta name=\"twitter:site\" content=\"@brhelpsysad\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/\"},\"author\":{\"name\":\"HelpSysAdmin\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/bdbe3d7d71a0c6a3cb474c18da574efb\"},\"headline\":\"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o\",\"datePublished\":\"2026-02-15T11:00:00+00:00\",\"dateModified\":\"2026-04-20T18:12:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/\"},\"wordCount\":796,\"publisher\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\/\\/helpsysadmin.com.br\\/blog\\/wp-content\\/uploads\\/2026\\/02\\/MySQL-Performance-Tuning.webp\",\"keywords\":[\"Database Optimization\",\"linux\",\"mariadb\",\"my.cnf\",\"mysql\",\"performance\",\"SQL Tuning\",\"SysAdmin\"],\"articleSection\":[\"Performance e Otimiza\u00e7\u00e3o (Tuning)\"],\"inLanguage\":\"pt-BR\"},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/\",\"url\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/\",\"name\":\"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\/\\/helpsysadmin.com.br\\/blog\\/wp-content\\/uploads\\/2026\\/02\\/MySQL-Performance-Tuning.webp\",\"datePublished\":\"2026-02-15T11:00:00+00:00\",\"dateModified\":\"2026-04-20T18:12:55+00:00\",\"description\":\"Servidor lento? Aprenda a otimizar o MariaDB em produ\u00e7\u00e3o editando o my.cnf. Reduza o Load e o TTFB com as configura\u00e7\u00f5es ideais de buffer e cache.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771720808\"},{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771759681\"},{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771790894\"},{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771801934\"}],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#primaryimage\",\"url\":\"https:\\/\\/helpsysadmin.com.br\\/blog\\/wp-content\\/uploads\\/2026\\/02\\/MySQL-Performance-Tuning.webp\",\"contentUrl\":\"https:\\/\\/helpsysadmin.com.br\\/blog\\/wp-content\\/uploads\\/2026\\/02\\/MySQL-Performance-Tuning.webp\",\"width\":620,\"height\":297},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/\",\"name\":\"Blog HelpSysAdmin\",\"description\":\"Webserver linux blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#organization\"},\"alternateName\":\"HelpSysAdmin Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#organization\",\"name\":\"HelpSysAdmin Gerenciamento de Servidores\",\"alternateName\":\"HelpSysAdmin\",\"url\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\/\\/mlkpd8g42nae.i.optimole.com\\/w:512\\/h:512\\/q:mauto\\/f:best\\/https:\\/\\/helpsysadmin.com.br\\/blog\\/wp-content\\/uploads\\/2020\\/12\\/favicon.png\",\"contentUrl\":\"https:\\/\\/mlkpd8g42nae.i.optimole.com\\/w:512\\/h:512\\/q:mauto\\/f:best\\/https:\\/\\/helpsysadmin.com.br\\/blog\\/wp-content\\/uploads\\/2020\\/12\\/favicon.png\",\"width\":512,\"height\":512,\"caption\":\"HelpSysAdmin Gerenciamento de Servidores\"},\"image\":{\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/brhelpsysad\",\"https:\\\/\\\/mastodon.social\\\/@helpsysadmin\"],\"description\":\"Oferecemos o gerenciamento de servidores dedicados, vps ou cloud. Apresentamos a melhor experi\u00eancia em atendimento e servi\u00e7o. Nosso time cuidar\u00e1 do seu servidor com backups, an\u00e1lises constantes, ajustes de seguran\u00e7a, realiza\u00e7\u00e3o de manuten\u00e7\u00e3o preventiva e corretiva, otimiza\u00e7\u00e3o de performance al\u00e9m de monitoramento 24\u00d77 com suporte Pr\u00f3 Ativo.\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1\",\"maxValue\":\"10\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/#\\\/schema\\\/person\\\/bdbe3d7d71a0c6a3cb474c18da574efb\",\"name\":\"HelpSysAdmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efc0007e6a313a844b72de257e05c6083b07b6ecc6983a4f71e06293ff2e22fd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efc0007e6a313a844b72de257e05c6083b07b6ecc6983a4f71e06293ff2e22fd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efc0007e6a313a844b72de257e05c6083b07b6ecc6983a4f71e06293ff2e22fd?s=96&d=mm&r=g\",\"caption\":\"HelpSysAdmin\"},\"sameAs\":[\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/\"]},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771720808\",\"position\":1,\"url\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771720808\",\"name\":\"Onde fica o arquivo de configura\u00e7\u00e3o my.cnf no Linux?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Na maioria das distribui\u00e7\u00f5es Linux (CentOS, AlmaLinux, Ubuntu), o arquivo principal de configura\u00e7\u00e3o do MariaDB est\u00e1 localizado em \\\/etc\\\/my.cnf ou dentro do diret\u00f3rio \\\/etc\\\/mysql\\\/. Sempre fa\u00e7a um backup antes de editar.\",\"inLanguage\":\"pt-BR\"},\"inLanguage\":\"pt-BR\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771759681\",\"position\":2,\"url\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771759681\",\"name\":\"Qual o valor ideal para o innodb_buffer_pool_size?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Em um servidor dedicado apenas para banco de dados, recomenda-se alocar entre 70% a 80% da mem\u00f3ria RAM total. Se o servidor for compartilhado (Web + Banco, como cPanel ou DirectAdmin), utilize entre 50% a 60% da RAM para evitar falta de mem\u00f3ria para o Apache\\\/Nginx.\",\"inLanguage\":\"pt-BR\"},\"inLanguage\":\"pt-BR\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771790894\",\"position\":3,\"url\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771790894\",\"name\":\"Preciso reiniciar o MariaDB ap\u00f3s alterar o my.cnf?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Sim. A maioria das altera\u00e7\u00f5es no arquivo my.cnf, especialmente as relacionadas ao tamanho de buffers e mem\u00f3ria (como o innodb_buffer_pool_size), exige um rein\u00edcio do servi\u00e7o (systemctl restart mariadb) para entrar em vigor.\",\"inLanguage\":\"pt-BR\"},\"inLanguage\":\"pt-BR\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771801934\",\"position\":4,\"url\":\"https:\\\/\\\/helpsysadmin.com.br\\\/blog\\\/otimizar-mariadb-my-cnf-producao\\\/#faq-question-1770771801934\",\"name\":\"O MySQLTuner \u00e9 seguro para usar em produ\u00e7\u00e3o?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"O MySQLTuner \u00e9 um script de leitura segura que n\u00e3o altera configura\u00e7\u00f5es sozinho; ele apenas sugere mudan\u00e7as. \u00c9 uma ferramenta excelente para diagn\u00f3stico, mas deve ser rodada ap\u00f3s o banco estar ativo por pelo menos 24 horas para gerar dados confi\u00e1veis.\",\"inLanguage\":\"pt-BR\"},\"inLanguage\":\"pt-BR\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o","description":"Servidor lento? Aprenda a otimizar o MariaDB em produ\u00e7\u00e3o editando o my.cnf. Reduza o Load e o TTFB com as configura\u00e7\u00f5es ideais de buffer e cache.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/","og_locale":"pt_BR","og_type":"article","og_title":"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o","og_description":"Servidor lento? Aprenda a otimizar o MariaDB em produ\u00e7\u00e3o editando o my.cnf. Reduza o Load e o TTFB com as configura\u00e7\u00f5es ideais de buffer e cache.","og_url":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/","og_site_name":"Blog HelpSysAdmin","article_published_time":"2026-02-15T11:00:00+00:00","article_modified_time":"2026-04-20T18:12:55+00:00","og_image":[{"width":620,"height":297,"url":"https:\/\/mlkpd8g42nae.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2026\/02\/MySQL-Performance-Tuning.webp","type":"image\/webp"}],"author":"HelpSysAdmin","twitter_card":"summary_large_image","twitter_creator":"@brhelpsysad","twitter_site":"@brhelpsysad","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#article","isPartOf":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/"},"author":{"name":"HelpSysAdmin","@id":"https:\/\/helpsysadmin.com.br\/blog\/#\/schema\/person\/bdbe3d7d71a0c6a3cb474c18da574efb"},"headline":"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o","datePublished":"2026-02-15T11:00:00+00:00","dateModified":"2026-04-20T18:12:55+00:00","mainEntityOfPage":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/"},"wordCount":796,"publisher":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/#organization"},"image":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#primaryimage"},"thumbnailUrl":"https:\/\/mlkpd8g42nae.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2026\/02\/MySQL-Performance-Tuning.webp","keywords":["Database Optimization","linux","mariadb","my.cnf","mysql","performance","SQL Tuning","SysAdmin"],"articleSection":["Performance e Otimiza\u00e7\u00e3o (Tuning)"],"inLanguage":"pt-BR"},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/","url":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/","name":"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o","isPartOf":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#primaryimage"},"image":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#primaryimage"},"thumbnailUrl":"https:\/\/mlkpd8g42nae.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2026\/02\/MySQL-Performance-Tuning.webp","datePublished":"2026-02-15T11:00:00+00:00","dateModified":"2026-04-20T18:12:55+00:00","description":"Servidor lento? Aprenda a otimizar o MariaDB em produ\u00e7\u00e3o editando o my.cnf. Reduza o Load e o TTFB com as configura\u00e7\u00f5es ideais de buffer e cache.","breadcrumb":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771720808"},{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771759681"},{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771790894"},{"@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771801934"}],"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#primaryimage","url":"https:\/\/mlkpd8g42nae.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2026\/02\/MySQL-Performance-Tuning.webp","contentUrl":"https:\/\/mlkpd8g42nae.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2026\/02\/MySQL-Performance-Tuning.webp","width":620,"height":297},{"@type":"BreadcrumbList","@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/helpsysadmin.com.br\/blog\/"},{"@type":"ListItem","position":2,"name":"Otimizar MariaDB em 5 Minutos: Guia Pr\u00e1tico do my.cnf em Produ\u00e7\u00e3o"}]},{"@type":"WebSite","@id":"https:\/\/helpsysadmin.com.br\/blog\/#website","url":"https:\/\/helpsysadmin.com.br\/blog\/","name":"Blog HelpSysAdmin","description":"Webserver linux blog","publisher":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/#organization"},"alternateName":"HelpSysAdmin Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/helpsysadmin.com.br\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/helpsysadmin.com.br\/blog\/#organization","name":"HelpSysAdmin Gerenciamento de Servidores","alternateName":"HelpSysAdmin","url":"https:\/\/helpsysadmin.com.br\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/helpsysadmin.com.br\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/mlkpd8g42nae.i.optimole.com\/w:512\/h:512\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2020\/12\/favicon.png","contentUrl":"https:\/\/mlkpd8g42nae.i.optimole.com\/w:512\/h:512\/q:mauto\/f:best\/https:\/\/helpsysadmin.com.br\/blog\/wp-content\/uploads\/2020\/12\/favicon.png","width":512,"height":512,"caption":"HelpSysAdmin Gerenciamento de Servidores"},"image":{"@id":"https:\/\/helpsysadmin.com.br\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/brhelpsysad","https:\/\/mastodon.social\/@helpsysadmin"],"description":"Oferecemos o gerenciamento de servidores dedicados, vps ou cloud. Apresentamos a melhor experi\u00eancia em atendimento e servi\u00e7o. Nosso time cuidar\u00e1 do seu servidor com backups, an\u00e1lises constantes, ajustes de seguran\u00e7a, realiza\u00e7\u00e3o de manuten\u00e7\u00e3o preventiva e corretiva, otimiza\u00e7\u00e3o de performance al\u00e9m de monitoramento 24\u00d77 com suporte Pr\u00f3 Ativo.","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1","maxValue":"10"}},{"@type":"Person","@id":"https:\/\/helpsysadmin.com.br\/blog\/#\/schema\/person\/bdbe3d7d71a0c6a3cb474c18da574efb","name":"HelpSysAdmin","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/efc0007e6a313a844b72de257e05c6083b07b6ecc6983a4f71e06293ff2e22fd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/efc0007e6a313a844b72de257e05c6083b07b6ecc6983a4f71e06293ff2e22fd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/efc0007e6a313a844b72de257e05c6083b07b6ecc6983a4f71e06293ff2e22fd?s=96&d=mm&r=g","caption":"HelpSysAdmin"},"sameAs":["https:\/\/helpsysadmin.com.br\/blog\/"]},{"@type":"Question","@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771720808","position":1,"url":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771720808","name":"Onde fica o arquivo de configura\u00e7\u00e3o my.cnf no Linux?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Na maioria das distribui\u00e7\u00f5es Linux (CentOS, AlmaLinux, Ubuntu), o arquivo principal de configura\u00e7\u00e3o do MariaDB est\u00e1 localizado em \/etc\/my.cnf ou dentro do diret\u00f3rio \/etc\/mysql\/. Sempre fa\u00e7a um backup antes de editar.","inLanguage":"pt-BR"},"inLanguage":"pt-BR"},{"@type":"Question","@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771759681","position":2,"url":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771759681","name":"Qual o valor ideal para o innodb_buffer_pool_size?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Em um servidor dedicado apenas para banco de dados, recomenda-se alocar entre 70% a 80% da mem\u00f3ria RAM total. Se o servidor for compartilhado (Web + Banco, como cPanel ou DirectAdmin), utilize entre 50% a 60% da RAM para evitar falta de mem\u00f3ria para o Apache\/Nginx.","inLanguage":"pt-BR"},"inLanguage":"pt-BR"},{"@type":"Question","@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771790894","position":3,"url":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771790894","name":"Preciso reiniciar o MariaDB ap\u00f3s alterar o my.cnf?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Sim. A maioria das altera\u00e7\u00f5es no arquivo my.cnf, especialmente as relacionadas ao tamanho de buffers e mem\u00f3ria (como o innodb_buffer_pool_size), exige um rein\u00edcio do servi\u00e7o (systemctl restart mariadb) para entrar em vigor.","inLanguage":"pt-BR"},"inLanguage":"pt-BR"},{"@type":"Question","@id":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771801934","position":4,"url":"https:\/\/helpsysadmin.com.br\/blog\/otimizar-mariadb-my-cnf-producao\/#faq-question-1770771801934","name":"O MySQLTuner \u00e9 seguro para usar em produ\u00e7\u00e3o?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"O MySQLTuner \u00e9 um script de leitura segura que n\u00e3o altera configura\u00e7\u00f5es sozinho; ele apenas sugere mudan\u00e7as. \u00c9 uma ferramenta excelente para diagn\u00f3stico, mas deve ser rodada ap\u00f3s o banco estar ativo por pelo menos 24 horas para gerar dados confi\u00e1veis.","inLanguage":"pt-BR"},"inLanguage":"pt-BR"}]}},"lang":"pt","translations":{"pt":3311},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/posts\/3311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/comments?post=3311"}],"version-history":[{"count":4,"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/posts\/3311\/revisions"}],"predecessor-version":[{"id":6154,"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/posts\/3311\/revisions\/6154"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/media\/3312"}],"wp:attachment":[{"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/media?parent=3311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/categories?post=3311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/helpsysadmin.com.br\/blog\/wp-json\/wp\/v2\/tags?post=3311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}