1. ¡OFERTA! con cupón "DIRVPS": hosting por $0,01 y también VPS Linux y Windows por $0,01 el primer mes por Interserver ← publi
    Descartar aviso
Descartar aviso
Al usar este sitio web, aceptas que nosotros y nuestros socios podamos establecer cookies para fines tales como personalizar el contenido y la publicidad. Más información.

VPS saturado

Tema en 'Servidores Dedicados' iniciado por ClusterIP, 4 Ago 2016.

  1. ClusterIP

    ClusterIP Usuario activo

    Hola,

    El VPS sirve una web (WordPress) con 6.000 visitas diarias y 300 simultáneas en picos máximos.

    Desde el martes vengo experimentando una carga brutal de Apache:
    CODE, HTML o PHP Insertado:
    top - 20:57:39 up  8:32,  3 users,  load average: 9.69, 9.22, 8.89
    Tasks: 258 total,  10 running, 247 sleeping,   0 stopped,   1 zombie
    Cpu(s): 81.6%us, 18.4%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:  16777216k total,  3557924k used, 13219292k free,        0k buffers
    Swap:        0k total,        0k used,        0k free,  1062840k cached
    Desempeño de procesos:
    CODE, HTML o PHP Insertado:
    Apache uso de memoria (MB): 5763.1
    Tamaño medio del proceso (MB): 34.9279
    Procesos apache: 165
    Configuración httpd:
    CODE, HTML o PHP Insertado:
    KeepAlive On
    MaxKeepAliveRequests 500
    KeepAliveTimeout 2
    
    <IfModule prefork.c>
    StartServers       2
    MinSpareServers    5
    MaxSpareServers   10
    ServerLimit      390
    MaxClients       390
    MaxRequestsPerChild 10000
     
  2.  
  3. semontejano

    semontejano Nuevo usuario

    Hola ClusterIP,

    ¿Has visto que procesos están levantados cuando te sube la carga del VPS?
    ¿Puedes ver si los procesos levantados están relacionados con xml-rpc o wp-login ?

    Si no estás seguro de esto, prueba a poner este contenido en el fichero .htaccess, reinicias apache y compruebas si la carga empieza a disminuir.

    <Files ~ "^(wp-login.php|xmlrpc.php)">
    Order deny,allow
    Deny from all
    Allow from TU.IP.XX.XX
    Satisfy all
    </Files>
    ErrorDocument 403 "Wordpress logins temporarily disabled"

    Un saludo,
     
  4. ClusterIP

    ClusterIP Usuario activo

    Hola semontejano,

    Antes de nada, agradecerte la lectura del post y tu aporte.

    Ninguno de los procesos guardan relación.
    Coloco salida de ps aux:
    CODE, HTML o PHP Insertado:
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.0  19236  1264 ?        Ss   Aug04   0:00 init
    
    nginx    24795  0.1  0.0  48140  5028 ?        D    11:49   0:06 nginx: worker p
    10000    27674  7.1  0.4 378564 72280 ?        S    12:51   1:14 /opt/plesk/php/
    10000    27675  7.1  0.4 396280 81984 ?        D    12:51   1:14 /opt/plesk/php/
    10000    27679  7.0  0.4 378584 72404 ?        S    12:51   1:12 /opt/plesk/php/
    10000    27684  7.1  0.4 373732 67996 ?        R    12:51   1:14 /opt/plesk/php/
    10000    27685  7.2  0.3 371476 66040 ?        R    12:51   1:15 /opt/plesk/php/
    10000    27694  7.1  0.3 358288 52956 ?        R    12:51   1:14 /opt/plesk/php/
    10000    27695  6.8  0.4 374312 69228 ?        R    12:51   1:10 /opt/plesk/php/
    10000    27696  6.9  0.2 353000 46884 ?        R    12:51   1:12 /opt/plesk/php/
    apache   27910  0.0  0.2 367200 35876 ?        S    12:56   0:00 /usr/sbin/httpd
    apache   28052  0.0  0.2 367200 35944 ?        S    12:58   0:00 /usr/sbin/httpd
    apache   28066  0.0  0.2 367204 35888 ?        S    12:58   0:00 /usr/sbin/httpd
    apache   28098  0.0  0.2 367196 35936 ?        S    12:59   0:00 /usr/sbin/httpd
    root     28153  0.0  0.0 169568  3060 ?        S    13:00   0:00 CROND
    root     28155  0.0  0.2 354548 36316 ?        Ss   13:00   0:00 /usr/bin/sw-eng
    apache   28172  0.0  0.2 367200 35944 ?        S    13:00   0:00 /usr/sbin/httpd
    apache   28232  0.0  0.2 367196 35916 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28239  0.0  0.2 367204 35896 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28240  0.0  0.2 367208 35940 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28241  0.0  0.2 367196 35920 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28242  0.0  0.2 367196 35912 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28247  0.0  0.2 367188 35844 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28248  0.0  0.2 367332 35972 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28253  0.0  0.2 367196 35848 ?        S    13:01   0:00 /usr/sbin/httpd
    apache   28293  0.0  0.2 367200 35912 ?        S    13:02   0:00 /usr/sbin/httpd
    root     28295  0.0  0.0 169568  2568 ?        S    02:10   0:00 CROND
    root     28299  0.0  0.0 106324   800 ?        Ss   02:10   0:00 /bin/sh -c [ -x
    psaadm   28301  0.0  0.0  44376  2256 ?        S    02:10   0:00 /usr/local/psa/
    root     28338  0.0  0.1 216756 17720 ?        S    02:10   0:02 /usr/bin/python
    apache   28437  0.0  0.2 367196 35836 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28444  0.0  0.2 367196 35932 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28465  0.0  0.2 367192 35888 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28475  0.0  0.2 367324 35928 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28489  0.0  0.2 367188 35840 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28577  0.0  0.2 367192 35884 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28580  0.0  0.2 367192 35860 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28582  0.0  0.2 367196 35860 ?        S    13:03   0:00 /usr/sbin/httpd
    apache   28594  0.0  0.2 367196 35900 ?        S    13:04   0:00 /usr/sbin/httpd
    apache   28596  0.0  0.2 367196 35880 ?        S    13:04   0:00 /usr/sbin/httpd
    apache   28603  0.0  0.2 367200 35924 ?        S    13:04   0:00 /usr/sbin/httpd
    apache   28614  0.0  0.2 367320 35936 ?        S    13:04   0:00 /usr/sbin/httpd
    apache   28633  0.0  0.2 367196 35832 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28636  0.0  0.2 367192 35912 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28652  0.0  0.2 367196 35828 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28691  0.0  0.2 367196 35816 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28702  0.0  0.2 367204 35908 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28706  0.0  0.2 367192 35796 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28715  0.0  0.2 367060 35676 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28718  0.0  0.2 367204 35820 ?        S    13:05   0:00 /usr/sbin/httpd
    apache   28720  0.0  0.2 367196 35860 ?        S    13:06   0:00 /usr/sbin/httpd
    apache   28721  0.0  0.2 367204 35896 ?        S    13:06   0:00 /usr/sbin/httpd
    apache   28726  0.0  0.2 367196 35876 ?        S    13:06   0:00 /usr/sbin/httpd
    apache   28733  0.0  0.2 367192 35820 ?        S    13:06   0:00 /usr/sbin/httpd
    apache   28735  0.0  0.2 367060 35700 ?        S    13:06   0:00 /usr/sbin/httpd
    apache   28745  0.0  0.2 367196 35848 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28746  0.0  0.2 367192 35760 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28747  0.0  0.2 367060 35720 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28751  0.0  0.2 367188 35748 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28752  0.0  0.2 367204 35844 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28754  0.0  0.2 367064 35712 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28755  0.0  0.2 367056 35652 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28760  0.0  0.2 367060 35576 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28763  0.0  0.2 367200 35820 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28765  0.0  0.2 367196 35836 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28767  0.0  0.2 367060 35716 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28769  0.0  0.2 366924 35568 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28772  0.0  0.2 366924 35524 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28773  0.0  0.2 367196 35808 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28774  0.0  0.2 367196 35792 ?        S    13:07   0:00 /usr/sbin/httpd
    apache   28777  0.0  0.2 367196 35860 ?        S    13:07   0:00 /usr/sbin/httpd
    drweb    28778  0.0  1.9 328232 321368 ?       S    13:07   0:00 /opt/drweb/drwe
    apache   28780  0.0  0.2 366924 35500 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28781  0.0  0.2 366924 35544 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28782  0.0  0.2 366924 35512 ?        S    13:08   0:00 /usr/sbin/httpd
    root     28783  0.1  0.0      0     0 ?        Z    13:08   0:00 [pmm] <defunct>
    apache   28786  0.0  0.2 366924 35512 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28787  0.0  0.2 367192 35788 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28788  0.0  0.2 366924 35508 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28789  0.0  0.2 366924 35448 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28790  0.0  0.2 366924 35368 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28791  0.0  0.2 367060 35564 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28792  0.0  0.2 366924 35388 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28793  0.0  0.2 366924 35332 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28794  0.0  0.2 366924 35372 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28796  0.0  0.2 366924 35376 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28798  0.0  0.2 366924 35376 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28800  0.0  0.2 366924 35356 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28801  0.0  0.2 367192 35792 ?        S    13:08   0:00 /usr/sbin/httpd
    10002    28803  2.8  0.2 446668 45376 ?        S    13:08   0:00 /opt/plesk/php/
    10002    28804  3.0  0.2 446660 45364 ?        S    13:08   0:00 /opt/plesk/php/
    apache   28805  0.0  0.2 367056 35596 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28806  0.0  0.2 367056 35612 ?        S    13:08   0:00 /usr/sbin/httpd
    apache   28809  0.0  0.2 366924 35440 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28810  0.0  0.2 366924 35332 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28811  0.0  0.2 366924 35448 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28812  0.0  0.2 366924 35364 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28813  0.0  0.2 366924 35392 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28814  0.0  0.2 366924 35416 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28815  0.0  0.2 366924 35388 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28816  0.0  0.2 366924 35376 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28818  0.0  0.2 366656 34004 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28819  0.0  0.2 366924 35448 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28820  0.0  0.2 366924 35372 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28822  0.0  0.2 366924 35368 ?        S    13:09   0:00 /usr/sbin/httpd
    apache   28823  0.0  0.2 366924 35344 ?        S    13:09   0:00 /usr/sbin/httpd
    root     28824  1.0  0.0 110492  1176 pts/0    R+   13:09   0:00 ps aux
    psaadm   31493  0.0  0.0  44268   788 ?        S    03:39   0:00 /usr/local/psa/
    psaadm   31494  0.0  0.2 375684 43764 ?        S    03:39   0:01 /usr/bin/sw-eng
    root     31517  0.0  0.2 221524 35996 ?        SN   03:39   0:17 /usr/bin/perl /
    root     32290  0.0  0.3 242376 51172 ?        Ss   06:20   0:04 /usr/bin/spamd
    popuser  32303  0.0  0.3 242904 51028 ?        S    06:21   0:03 spamd child
    Lo que parece saturar la CPU son los procesos de Plesk sobre PHP.
    La carga excesiva no es puntual, desde hace 30 horas está como se aprecia en el top que coloqué inicialmente y no baja nunca. Cualquier petición agota el timeout.
     
  5. ClusterIP

    ClusterIP Usuario activo

    Memoria consumida por Apache:
    CODE, HTML o PHP Insertado:
    [root@seten ~]# ps -ylC httpd --sort:rss
    S   UID   PID  PPID  C PRI  NI   RSS    SZ WCHAN  TTY          TIME CMD
    Z    48 28898 27669  0  80   0     0     0 exit   ?        00:00:00 ht <d
    S    48 27671 27669  0  80   0 28824 64333 poll_s ?        00:00:01 httpd
    S    48 29015 27669  0  80   0 35508 91731 semtim ?        00:00:00 httpd
    S    48 28991 27669  0  80   0 35516 91731 poll_s ?        00:00:00 httpd
    S    48 28993 27669  0  80   0 35524 91731 poll_s ?        00:00:00 httpd
    S    48 29009 27669  0  80   0 35528 91731 poll_s ?        00:00:00 httpd
    S    48 29014 27669  0  80   0 35540 91766 semtim ?        00:00:00 httpd
    S    48 29012 27669  0  80   0 35548 91731 poll_s ?        00:00:00 httpd
    S    48 28982 27669  0  80   0 35560 91731 poll_s ?        00:00:00 httpd
    S    48 28947 27669  0  80   0 35576 91731 poll_s ?        00:00:00 httpd
    S    48 29017 27669  0  80   0 35576 91765 ep_pol ?        00:00:00 httpd
    S    48 29025 27669  0  80   0 35576 91765 semtim ?        00:00:00 httpd
    S    48 28981 27669  0  80   0 35580 91731 poll_s ?        00:00:00 httpd
    S    48 28973 27669  0  80   0 35612 91765 poll_s ?        00:00:00 httpd
    S    48 29019 27669  0  80   0 35616 91766 poll_s ?        00:00:00 httpd
    S    48 28968 27669  0  80   0 35636 91764 poll_s ?        00:00:00 httpd
    S    48 28995 27669  0  80   0 35636 91766 poll_s ?        00:00:00 httpd
    S    48 28972 27669  0  80   0 35640 91731 semtim ?        00:00:00 httpd
    S    48 28998 27669  0  80   0 35640 91764 poll_s ?        00:00:00 httpd
    S    48 28957 27669  0  80   0 35644 91766 semtim ?        00:00:00 httpd
    S    48 28969 27669  0  80   0 35668 91765 poll_s ?        00:00:00 httpd
    S    48 28882 27669  0  80   0 35708 91764 poll_s ?        00:00:00 httpd
    S    48 28971 27669  0  80   0 35708 91766 poll_s ?        00:00:00 httpd
    S    48 28853 27669  0  80   0 35712 91766 poll_s ?        00:00:00 httpd
    S    48 29000 27669  0  80   0 35732 91797 semtim ?        00:00:00 httpd
    S    48 29020 27669  0  80   0 35740 91799 semtim ?        00:00:00 httpd
    S    48 28983 27669  0  80   0 35772 91799 poll_s ?        00:00:00 httpd
    S    48 29021 27669  0  80   0 35780 91801 semtim ?        00:00:00 httpd
    S    48 28956 27669  0  80   0 35808 91797 poll_s ?        00:00:00 httpd
    S    48 28782 27669  0  80   0 35820 91798 poll_s ?        00:00:00 httpd
    S    48 28923 27669  0  80   0 35824 91799 poll_s ?        00:00:00 httpd
    S    48 28927 27669  0  80   0 35828 91797 poll_s ?        00:00:00 httpd
    S    48 28715 27669  0  80   0 35832 91798 poll_s ?        00:00:00 httpd
    S    48 28974 27669  0  80   0 35832 91798 poll_s ?        00:00:00 httpd
    S    48 28907 27669  0  80   0 35836 91800 poll_s ?        00:00:00 httpd
    S    48 29023 27669  0  80   0 35840 91799 poll_s ?        00:00:00 httpd
    S    48 28868 27669  0  80   0 35844 91797 poll_s ?        00:00:00 httpd
    S    48 28806 27669  0  80   0 35856 91798 poll_s ?        00:00:00 httpd
    S    48 28820 27669  0  80   0 35856 91798 poll_s ?        00:00:00 httpd
    S    48 28910 27669  0  80   0 35856 91799 poll_s ?        00:00:00 httpd
    S    48 29011 27669  0  80   0 35856 91797 poll_s ?        00:00:00 httpd
    S    48 28848 27669  0  80   0 35860 91799 poll_s ?        00:00:00 httpd
    S    48 28970 27669  0  80   0 35860 91797 poll_s ?        00:00:00 httpd
    S    48 28996 27669  0  80   0 35860 91799 poll_s ?        00:00:00 httpd
    S    48 28792 27669  0  80   0 35864 91799 poll_s ?        00:00:00 httpd
    S    48 28891 27669  0  80   0 35872 91799 semtim ?        00:00:00 httpd
    S    48 28912 27669  0  80   0 35876 91799 poll_s ?        00:00:00 httpd
    S    48 28767 27669  0  80   0 35880 91798 poll_s ?        00:00:00 httpd
    S    48 28962 27669  0  80   0 35880 91798 poll_s ?        00:00:00 httpd
    S    48 28975 27669  0  80   0 35880 91798 poll_s ?        00:00:00 httpd
    S    48 28786 27669  0  80   0 35888 91798 poll_s ?        00:00:00 httpd
    S    48 28930 27669  0  80   0 35888 91797 semtim ?        00:00:00 httpd
    S    48 28816 27669  0  80   0 35900 91800 poll_s ?        00:00:00 httpd
    S    48 28895 27669  0  80   0 35900 91799 poll_s ?        00:00:00 httpd
    S    48 28954 27669  0  80   0 35900 91798 poll_s ?        00:00:00 httpd
    S    48 28720 27669  0  80   0 35908 91799 poll_s ?        00:00:00 httpd
    S    48 28937 27669  0  80   0 35908 91798 poll_s ?        00:00:00 httpd
    S    48 28846 27669  0  80   0 35912 91798 semtim ?        00:00:00 httpd
    S    48 28885 27669  0  80   0 35916 91830 poll_s ?        00:00:00 httpd
    S    48 28909 27669  0  80   0 35916 91799 poll_s ?        00:00:00 httpd
    S    48 28787 27669  0  80   0 35920 91831 poll_s ?        00:00:00 httpd
    S    48 28932 27669  0  80   0 35920 91798 poll_s ?        00:00:00 httpd
    S    48 28999 27669  0  80   0 35920 91834 semtim ?        00:00:00 httpd
    S    48 28746 27669  0  80   0 35924 91832 poll_s ?        00:00:00 httpd
    S    48 28765 27669  0  80   0 35924 91799 semtim ?        00:00:00 httpd
    S    48 28849 27669  0  80   0 35924 91798 poll_s ?        00:00:00 httpd
    S    48 28818 27669  0  80   0 35928 91798 semtim ?        00:00:00 httpd
    S    48 28888 27669  0  80   0 35932 91799 poll_s ?        00:00:00 httpd
    S    48 28814 27669  0  80   0 35936 91797 poll_s ?        00:00:00 httpd
    S    48 28242 27669  0  80   0 35940 91799 semtim ?        00:00:00 httpd
    S    48 28444 27669  0  80   0 35940 91799 poll_s ?        00:00:00 httpd
    S    48 28781 27669  0  80   0 35940 91831 poll_s ?        00:00:00 httpd
    S    48 28726 27669  0  80   0 35944 91799 poll_s ?        00:00:00 httpd
    S    48 28864 27669  0  80   0 35944 91833 poll_s ?        00:00:00 httpd
    S    48 28893 27669  0  80   0 35948 91830 poll_s ?        00:00:00 httpd
    S    48 28926 27669  0  80   0 35948 91834 poll_s ?        00:00:00 httpd
    S     0 27669     1  0  80   0 43188 91664 poll_s ?        00:00:01 httpd
     
  6. semontejano

    semontejano Nuevo usuario

    Hola ClusterIP,

    En el ps no estamos viendo que procesos está ejecutando apache.

    Para poder ver los procesos donde se están ejecutando, asegurate que en el fichero rutaconfigapache/conf/extra/httpd-info.conf tienes esto:

    <Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from tu.ip.xx.xx
    Allow from 127.0.0.1
    </Location>

    ExtendedStatus On

    <Location /server-info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from tu.ip.xx.xx
    Allow from 127.0.0.1
    </Location>

    Si tienes este contenido, a través de la consola, puedes ejecutar el comando: service httpd fullstatus
    Aquí podrás observar donde están ejecutándose las peticiones web.

    Si puedes, enviame la salida del comando para ver donde se están ejecutando las peticiones.

    Si quieres hablame por privado y revisamos esto.

    Un saludo,
     
  7. WebTech

    WebTech Súper Moderador Miembro del Staff Moderador CH

    Primer consejo, deja de usar Apache y migra a Nginx, tendrás mejor performance x2 o más, dependiendo de cómo ejecutes PHP (php-fpm o hhvm).

    Un saludo,
     


Alojamiento web, Hosting Reseller, Servidores Dedicados - All in Hosting


    
    
    
    
Blog · Sitios amigos: GuiaHosting · Unidominios · Interalta ·