Meu Ubuntu 16.04 Install with WordPress continua abrindo processos do apache2, comendo memória [closed]

0

Após uma reinicialização limpa do servidor, o servidor ficará bem. Ao visitar o site e clicar em alguns links, os processos do apache2 são criados, mas nunca terminados, e constantemente ocupam mais e mais memória até o servidor travar. A única maneira de corrigir isso é reiniciando o serviço apache2 para finalizar todos os processos ou reiniciando o servidor novamente.

Minhas tentativas incluíram a restauração do tema padrão do WordPress, a desativação de todos os plugins e a navegação no site novamente, embora pareça que o problema persista após o fato. Eu também tentei fazer pequenas configurações no apache.conf, bem como no arquivo php.ini.

Estou bastante perdida no momento e tenho feito pesquisas para tentar descobrir qual é a questão, mas só acabei em becos sem saída.

A minha pergunta é: por que o apache2 e o mysqld estão ocupando tanta memória e impedem que eles façam isso para impedir que o servidor travasse?

Abaixo está uma imagem dos processos atualmente em execução, mostrando o apache consumindo memória e gerando vários processos do apache2.

LogsdeerrodoApache:

[FriAug1018:15:48.0705182018][mpm_prefork:notice][pid7451]AH00169:caughtSIGTERM,shuttingdown[FriAug1018:15:48.9485162018][ssl:warn][pid11222]AH01909:127.0.1.1:443:0servercertificatedoesNOTincludeanIDwhichmatchestheservername[FriAug1018:15:49.1437492018][ssl:warn][pid11223]AH01909:127.0.1.1:443:0servercertificatedoesNOTincludeanIDwhichmatchestheservername[FriAug1018:15:49.1544712018][mpm_prefork:notice][pid11223]AH00163:Apache/2.4.18(Ubuntu)OpenSSL/1.0.2gconfigured--resumingnormaloperations[FriAug1018:15:49.1545302018][core:notice][pid11223]AH00094:Commandline:'/usr/sbin/apache2'mmap()failed:[12]Cannotallocatememorymmap()failed:[12]Cannotallocatememory(Repeat...)

LogsdeacessodoApache(botspodemestarcausandoisso?):

5.9.61.232--[10/Aug/2018:18:40:11+0000]"GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_orderby=rating&product_view=list HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:40:13 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=date&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:40:13 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=grid&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:40:23 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=grid&product_order=desc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:40:23 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=date&product_order=desc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:40:29 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=grid&product_orderby=date HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:40:29 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=date&product_view=grid HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:40:34 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=date&product_view=list HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:40:34 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=grid&product_orderby=default HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:40:41 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=default&product_count=16 HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:40:41 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=grid&product_orderby=name HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:40:49 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=default&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:40:49 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=grid&product_orderby=rating HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:40:55 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=list&product_orderby=date HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:40:54 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=default&product_order=desc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:01 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=default&product_view=grid HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:01 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=list&product_orderby=default HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:10 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=list&product_orderby=name HTTP/1.1" 200 436 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:12 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=list&product_orderby=popularity HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:10 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=default&product_view=list HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:14 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=name&product_count=16 HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:14 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=list&product_orderby=price HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:21 +0000] "GET /product-category/personalized-jewelry/page/10/?produ&product_count=3&product_view=list&product_orderby=rating HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:21 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=name&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:30 +0000] "GET /product-category/personalized-jewelry/page/2/?prod&product_count=16&product_order&product_orderby=name HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:30 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=name&product_order=desc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:36 +0000] "GET /product-category/personalized-jewelry/page/2/?prod&product_count=16&product_order&product_orderby=price HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:36 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=name&product_view=grid HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:43 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=name&product_view=list HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:43 +0000] "GET /product-category/personalized-jewelry/page/2/?prod&product_count=16&product_order&product_orderby=rating HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:41:51 +0000] "GET /product-category/personalized-jewelry/page/2/?product_count=16&product_orderby=date&product_view&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:41:51 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=popularity&product_count=16 HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:02 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=popularity&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:02 +0000] "GET /product-category/personalized-jewelry/page/2/?product_count=16&product_orderby=default&product_view&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:10 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=popularity&product_order=desc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:10 +0000] "GET /product-category/personalized-jewelry/page/2/?product_count=16&product_orderby=popularity&product_view&product_order=desc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:20 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=popularity&product_view=grid HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:20 +0000] "GET /product-category/personalized-jewelry/page/3/?product_count=16&product_orderby=date&product_view&product_order=asc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:26 +0000] "GET /product-category/personalized-jewelry/page/3/?product_count=16&product_orderby=default&product_v HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:26 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=popularity&product_view=list HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:35 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=price&product_count=16 HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:35 +0000] "GET /product-category/personalized-jewelry/page/3/?product_count=16&product_orderby=rating&product_v HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:41 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=rating&product_view=grid HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:41 +0000] "GET /product-category/personalized-jewelry/page/3/?product_count=16&product_orderby=rating&product_v&product_order=desc HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:49 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_orderby=rating&product_view=list HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:49 +0000] "GET /product-category/personalized-jewelry/page/5/?prod&product_count=16&product_order=desc&product_orderby=date HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.141.8 - - [10/Aug/2018:18:42:58 +0000] "GET /product-category/personalized-jewelry/page/7/?produ=&product_orderb=&product_view=grid&product_count=16 HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
5.9.61.232 - - [10/Aug/2018:18:42:58 +0000] "GET /product-category/personalized-jewelry/page/5/?prod&product_count=16&product_order=desc&product_orderby=default HTTP/1.1" 200 374 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
    
por Rob Calaceto 10.08.2018 / 20:24

2 respostas

1

Parece que seu site está sendo atingido por um rastreador da Web particularmente agressivo. Você pode olhar para ver se você pode excluir ou limitar o seu site a partir desse bot, ou bloqueá-lo no firewall, se não é um bot que você particularmente se preocupa. Se preferir, adicione um robots.txt arquivo ao seu site para desencorajar esses bots.

    
por 10.08.2018 / 21:29
0

Da imagem htop , acho que mysqld está comendo mais memória do que o apache. Estou tentando fornecer algumas soluções gerais que podem ser úteis.

  1. Tente ajustar os parâmetros mysqld em /etc/my.cnf . Por favor, google como reduzir o consumo de memória mysql .

  2. Acho que o consumo de memória de apache/nginx + php-fpm é menor do que se você lida com php diretamente com o apache. Em ambos os casos, você pode controlar o número máximo de php thread, memória por thread, etc. Por favor, faça alguns ajustes lá.

  3. O mais importante é analisar os arquivos de log mysqld , apache2 etc. Leia man páginas para os locais dos arquivos de log padrão e encontre qualquer erro.

Espero que seja ajuda.

    
por 10.08.2018 / 20:42