Jump to content
Sign in to follow this  
Anderson Medeiros

Mysql com alta carga ao logar no wp-admin

Recommended Posts

Olá pessoa, tenho uma VPS na Vultr usando o Cyberpanel, nela tenho hospedado um site em Wordpress. A uns 10 dias tenho enfrentado um problema de uso de alta carga da CPU que não ocorria anteriormente (as visitas ficaram na mesma média). Depois de analisar bastante e tentar resolver o problema observei que o uso do CPU fica normal até eu logar no wp-admin e então ele vai a 100%. Com o comando top observei que o mysql passa de -10% de uso para até 95%. So um pouco leigo e geralmente consigo me virar mas este problema esta me dando bastante trabalho. Gostaria de saber se alguém tem uma sugestão do que possa ser.
Agradeço a atenção e peço desculpas se este não é o local exato desta postagem.

Share this post


Link to post
Share on other sites

Quais plugins vc tem instalado? O admin do WP pode acumular MUITA coisa deixando o site completamente pesado.


"I could while away the hours..."

Share this post


Link to post
Share on other sites

Acumular muita coisa você diz em respeito de plugins ou a que?

 

Estes são os plugins ativados no momento:
404 to 301
Accelerated Mobile Pages
AdSense Integration WP QUADS
Akismet Anti-Spam
Editor clássico
Elementor
Elementor Pro
LiteSpeed Cache
OneSignal Push Notifications
Really Simple SSL
SEO Smart Links
WP Extended Search
Yoast SEO Premium

 

Abaixo os log do mysql tunner:

 >>  MySQLTuner 1.7.13 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering

[--] Skipped version check for MySQLTuner script
Please enter your MySQL administrative login: sT2lFvEvBcGo4J
Please enter your MySQL administrative password: [!!] failed to execute: SHOW SLAVE STATUS\G
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW SLAVE HOSTS
[!!] FAIL Execute SQL / return code: 256
[OK] Currently running supported MySQL version 10.3.9-MariaDB
[OK] Operating on 64-bit architecture

-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/lib/mysql/exerciciosvps.err(0B)
[!!] Log file /var/lib/mysql/exerciciosvps.err doesn't exist
[!!] Log file /var/lib/mysql/exerciciosvps.err isn't readable.

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE
[--] Data in MyISAM tables: 40.8M (Tables: 29)
[--] Data in InnoDB tables: 1.2M (Tables: 19)
[OK] Total fragmented tables: 0

-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates during querying INFORMATION_SCHEMA.

-------- Security Recommendations ------------------------------------------------------------------
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE TRIM(USER) = '' OR USER IS NULL
[!!] FAIL Execute SQL / return code: 256
[OK] There are no anonymous accounts for any database users
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE (IF(plugin='mysql_native_password', authentication_string, 'password') = '' OR IF(plugin='mysql_native_password', authentication_string, 'password') IS NULL) AND plugin NOT IN ('unix_socket', 'win_socket', 'auth_pam_compat')
[!!] FAIL Execute SQL / return code: 256
[OK] All database users have passwords assigned
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE CAST(IF(plugin='mysql_native_password', authentication_string, 'password') as Binary) = PASSWORD(user) OR CAST(IF(plugin='mysql_native_password', authentication_string, 'password') as Binary) = PASSWORD(UPPER(user)) OR CAST(IF(plugin='mysql_native_password', authentication_string, 'password') as Binary) = PASSWORD(CONCAT(UPPER(LEFT(User, 1)), SUBSTRING(User, 2, LENGTH(User))))
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE HOST='%'
[!!] FAIL Execute SQL / return code: 256
[!!] There is no basic password file list!

-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined

-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 12h 50m 29s (1M q [28.564 qps], 20K conn, TX: 11G, RX: 176M)
[--] Reads / Writes: 99% / 1%
[--] Binary logging is disabled
[--] Physical Memory     : 991.6M
[--] Max MySQL memory    : 856.4M
[--] Other process memory: 177.3M
[--] Total buffers: 417.0M global + 2.9M per thread (151 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 466.5M (47.04% of installed RAM)
[!!] Maximum possible memory usage: 856.4M (86.37% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/1M)
[OK] Highest usage of available connections: 11% (17/151)
[OK] Aborted connections: 0.01%  (2/20731)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 1M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 306K sorts)
[OK] No joins without indexes
[!!] Temporary tables created on disk: 70% (102K on disk / 146K total)
[OK] Thread cache hit rate: 99% (17 created / 20K connections)
[OK] Table cache hit rate: 88% (104 open / 118 opened)
[OK] Open file limit used: 0% (108/16K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)

-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
[--] Memory used by P_S: 0B
[--] Sys schema isn't installed.

-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 1 thread(s).
[--] Using default value is good enough for your version (10.3.9-MariaDB)

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 20.3% (27M used / 134M cache)
[OK] Key buffer size / total MyISAM indexes: 128.0M/4.8M
[OK] Read Key buffer hit rate: 100.0% (10B cached / 4K reads)
[!!] Write Key buffer hit rate: 85.6% (1K cached / 1K writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 128.0M/1.2M
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (75 %): 48.0M * 2/128.0M should be equal 25%
[OK] InnoDB buffer pool instances: 1
[--] Number of InnoDB Buffer Pool Chunk : 1 for 1 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 99.84% (326886 hits/ 327408 total)
[!!] InnoDB Write Log efficiency: 81.84% (604 hits/ 738 total)
[OK] InnoDB log waits: 0.00% (0 waits / 134 writes)

-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/1B
[OK] Aria pagecache hit rate: 99.7% (29M cached / 89K reads)

-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.

-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.

-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.

-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] Binlog format: MIXED
[--] XA support enabled: ON
[--] Semi synchronous replication Master: OFF
[--] Semi synchronous replication Slave: OFF
[--] This is a standalone server

-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    MySQL was started within the last 24 hours - recommendations may be inaccurate
    Reduce your overall MySQL memory footprint for system stability
    Dedicate this server to your database for highest performance.
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Performance schema should be activated for better diagnostics
    Consider installing Sys schema from https://github.com/mysql/mysql-sys
    Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: http://bit.ly/2wgkDvS
Variables to adjust:
    query_cache_size (=0)
    query_cache_type (=0)
    query_cache_limit (> 1M, or use smaller result sets)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    performance_schema = ON enable PFS
    innodb_log_file_size should be (=16M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.

 

 

Share this post


Link to post
Share on other sites

Desculpa perguntar, mas o YOAST premium você comprou ou baixou de algum lugar?

PS: SEO smart links tá inativo e não funciona, tem um outro de nome parecido que faz as mesmas funções. O usuário retomou o desenvolvimento.

 


"I could while away the hours..."

Share this post


Link to post
Share on other sites

O YOAST premium peguei de um rapaz no mercado livre, será que pode ser isso?
O SEO smart links ainda está criando os links automáticos sim. Acabei de conferir em algums posts. Mas vou procurar um mais atualizado ja que este está inativo.

Share this post


Link to post
Share on other sites

Anderson, pode ser isso. Remova ele completamente do diretório de plugins. Plugins deste tipo fazem inúmeras solicitações, mandam sabe-se lá pra onde e fazem sabem lá o quê com o seu admin.

Faça o teste e baixe o original do painel de plugins mesmo. Dê uma olhada nos templates também. Já consertei MUITO blog por conta de plugin assim que saía modificando arquivos e dando acesso direto ao WP.


"I could while away the hours..."

Share this post


Link to post
Share on other sites

Sempre que se esta logado no admin do wordpress o consumo de cpu e memoria vai ficar mais alto um pouco, isso é normal no wordpress. E vai aumentar mais por exemplo se estiver fazendo postagens, enviando conteúdo etc.

O que a @AngelCosta falou também procede, verifique os plugins instalados pois alguns consomem recursos até mesmo quando o admin loga. E procure não usar plugins pirateados, pois só vai ter dar dor de cabeça.

  • Like 2

Gerenciamento e otimização de servidores: Centos, Debian, Ubuntu, Cpanel e VestaCP.
Cloud otimizado e otimização para: Wordpress e Magento.
Virtualização: Implementação e gerenciamento Virtualizor, Proxmox, Openstack e VMware.

Share this post


Link to post
Share on other sites

o aumento não é so um pouco, é muito, tipo de 10% de uso da CPU para 90% pelo mysql, fica tudo muito lento que nem consigo trabalhar, isso começou tem uns 10 dias, não fiz nada diferente que pudesse ter ocasionado isto.

Share this post


Link to post
Share on other sites

Olá pessoa, so para postar os resultados, aparentemente o problema foi resolvido, depois que desativei e exclui o plugin do yost tudo voltou ao normal. Ativei a versão free e está ok. Agradeço a ajuda.

 

OBS: Nunca mais uso plugins que não forem oficiais.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.




×
×
  • Create New...