Foros del Web » Administración de Sistemas » Software para Servers »

Problema RAM y APACHE servidor dedicado

Estas en el tema de Problema RAM y APACHE servidor dedicado en el foro de Software para Servers en Foros del Web. Buenas tardes, desde hace unos cuantos dias estoy experimentando unos problemas en mi servidor dedicado que utilizo para web y correo electronico. A los minutos ...
  #1 (permalink)  
Antiguo 31/08/2013, 09:15
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Problema RAM y APACHE servidor dedicado

Buenas tardes, desde hace unos cuantos dias estoy experimentando unos problemas en mi servidor dedicado que utilizo para web y correo electronico.

A los minutos de estar apache iniciado se consume la memoria ram y llego a tener 500 procesos en sleep, el servidor se queda bloqueado y no sirve las peticiones web.

Ya no se que mas hacer para solucionar el problema, a ver si podeis hecharme una mano....
  #2 (permalink)  
Antiguo 31/08/2013, 09:16
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

Adjunto resultado del TOP y configuración de APACHE:

Real memory: 15.57 GB total / 6.89 GB free / 6.81 GB cached Swap space: 1 GB total / 1007.87 MB free

ID de Proceso Propietario Medida Comando
3048 mysql 1116452 kB /usr/sbin/mysqld --basedir=/usr --datadir=/home/mysql --user=mysql --pid-file=/v ...
3173 clamav 286224 kB /usr/sbin/clamd
8973 www-data 268808 kB /usr/sbin/apache2 -k start
9342 www-data 268740 kB /usr/sbin/apache2 -k start
8896 www-data 268732 kB /usr/sbin/apache2 -k start
8933 www-data 268732 kB /usr/sbin/apache2 -k start
8940 www-data 268732 kB /usr/sbin/apache2 -k start
9248 www-data 268732 kB /usr/sbin/apache2 -k start
9288 www-data 268732 kB /usr/sbin/apache2 -k start
9292 www-data 268732 kB /usr/sbin/apache2 -k start
9326 www-data 268732 kB /usr/sbin/apache2 -k start
8892 www-data 268708 kB /usr/sbin/apache2 -k start
9152 www-data 268700 kB /usr/sbin/apache2 -k start
9340 www-data 268692 kB /usr/sbin/apache2 -k start
9350 www-data 268692 kB /usr/sbin/apache2 -k start
8891 www-data 268664 kB /usr/sbin/apache2 -k start
9486 www-data 268664 kB /usr/sbin/apache2 -k start
9367 www-data 268620 kB /usr/sbin/apache2 -k start
8903 www-data 268524 kB /usr/sbin/apache2 -k start
9143 www-data 268524 kB /usr/sbin/apache2 -k start
9433 www-data 268524 kB /usr/sbin/apache2 -k start
9449 www-data 268524 kB /usr/sbin/apache2 -k start
9588 www-data 268524 kB /usr/sbin/apache2 -k start
9594 www-data 268524 kB /usr/sbin/apache2 -k start
9596 www-data 268524 kB /usr/sbin/apache2 -k start
9603 www-data 268524 kB /usr/sbin/apache2 -k start
9605 www-data 268524 kB /usr/sbin/apache2 -k start
9607 www-data 268524 kB /usr/sbin/apache2 -k start
9611 www-data 268524 kB /usr/sbin/apache2 -k start
9616 www-data 268524 kB /usr/sbin/apache2 -k start
9625 www-data 268524 kB /usr/sbin/apache2 -k start
9636 www-data 268524 kB /usr/sbin/apache2 -k start
8890 www-data 268348 kB /usr/sbin/apache2 -k start
9140 www-data 268348 kB /usr/sbin/apache2 -k start
9097 www-data 268344 kB /usr/sbin/apache2 -k start
9268 www-data 268344 kB /usr/sbin/apache2 -k start
9291 www-data 268344 kB /usr/sbin/apache2 -k start
9287 www-data 268340 kB /usr/sbin/apache2 -k start
9325 www-data 268340 kB /usr/sbin/apache2 -k start
9341 www-data 268340 kB /usr/sbin/apache2 -k start
9346 www-data 268340 kB /usr/sbin/apache2 -k start
8887 www-data 268336 kB /usr/sbin/apache2 -k start
8889 www-data 268336 kB /usr/sbin/apache2 -k start
8894 www-data 268336 kB /usr/sbin/apache2 -k start
8895 www-data 268336 kB /usr/sbin/apache2 -k start
8917 www-data 268336 kB /usr/sbin/apache2 -k start
8918 www-data 268336 kB /usr/sbin/apache2 -k start
8925 www-data 268336 kB /usr/sbin/apache2 -k start
8927 www-data 268336 kB /usr/sbin/apache2 -k start
8936 www-data 268336 kB /usr/sbin/apache2 -k start
8968 www-data 268336 kB /usr/sbin/apache2 -k start
8972 www-data 268336 kB /usr/sbin/apache2 -k start
8975 www-data 268336 kB /usr/sbin/apache2 -k start
8976 www-data 268336 kB /usr/sbin/apache2 -k start
8978 www-data 268336 kB /usr/sbin/apache2 -k start
9026 www-data 268336 kB /usr/sbin/apache2 -k start
9091 www-data 268336 kB /usr/sbin/apache2 -k start
9093 www-data 268336 kB /usr/sbin/apache2 -k start
9094 www-data 268336 kB /usr/sbin/apache2 -k start
9095 www-data 268336 kB /usr/sbin/apache2 -k start
9115 www-data 268336 kB /usr/sbin/apache2 -k start
9148 www-data 268336 kB /usr/sbin/apache2 -k start
9253 www-data 268336 kB /usr/sbin/apache2 -k start
9260 www-data 268336 kB /usr/sbin/apache2 -k start
9289 www-data 268336 kB /usr/sbin/apache2 -k start
9379 www-data 268336 kB /usr/sbin/apache2 -k start
9432 www-data 268336 kB /usr/sbin/apache2 -k start
9442 www-data 268336 kB /usr/sbin/apache2 -k start
9444 www-data 268336 kB /usr/sbin/apache2 -k start
9468 www-data 268336 kB /usr/sbin/apache2 -k start
9469 www-data 268336 kB /usr/sbin/apache2 -k start
9478 www-data 268336 kB /usr/sbin/apache2 -k start
9482 www-data 268336 kB /usr/sbin/apache2 -k start
9483 www-data 268336 kB /usr/sbin/apache2 -k start
9489 www-data 268336 kB /usr/sbin/apache2 -k start
9585 www-data 268336 kB /usr/sbin/apache2 -k start
9622 www-data 268336 kB /usr/sbin/apache2 -k start
9487 www-data 268324 kB /usr/sbin/apache2 -k start
9599 www-data 268324 kB /usr/sbin/apache2 -k start
9631 www-data 268324 kB /usr/sbin/apache2 -k start
9321 www-data 268308 kB /usr/sbin/apache2 -k start
9431 www-data 268296 kB /usr/sbin/apache2 -k start
9344 www-data 268292 kB /usr/sbin/apache2 -k start
8893 www-data 268288 kB /usr/sbin/apache2 -k start
8934 www-data 268288 kB /usr/sbin/apache2 -k start
8938 www-data 268288 kB /usr/sbin/apache2 -k start
8939 www-data 268288 kB /usr/sbin/apache2 -k start
8970 www-data 268288 kB /usr/sbin/apache2 -k start
8971 www-data 268288 kB /usr/sbin/apache2 -k start
8974 www-data 268288 kB /usr/sbin/apache2 -k start
9113 www-data 268288 kB /usr/sbin/apache2 -k start
9139 www-data 268288 kB /usr/sbin/apache2 -k start
9141 www-data 268288 kB /usr/sbin/apache2 -k start
9293 www-data 268288 kB /usr/sbin/apache2 -k start
9559 www-data 268288 kB /usr/sbin/apache2 -k start
9563 www-data 268288 kB /usr/sbin/apache2 -k start
9564 www-data 268288 kB /usr/sbin/apache2 -k start
9579 www-data 268288 kB /usr/sbin/apache2 -k start
9583 www-data 268288 kB /usr/sbin/apache2 -k start
9584 www-data 268288 kB /usr/sbin/apache2 -k start
9586 www-data 268288 kB /usr/sbin/apache2 -k start
9589 www-data 268288 kB /usr/sbin/apache2 -k start
9592 www-data 268288 kB /usr/sbin/apache2 -k start
9597 www-data 268288 kB /usr/sbin/apache2 -k start
9602 www-data 268288 kB /usr/sbin/apache2 -k start
9604 www-data 268288 kB /usr/sbin/apache2 -k start
9608 www-data 268288 kB /usr/sbin/apache2 -k start
9613 www-data 268288 kB /usr/sbin/apache2 -k start
9619 www-data 268288 kB /usr/sbin/apache2 -k start
9620 www-data 268288 kB /usr/sbin/apache2 -k start
9621 www-data 268288 kB /usr/sbin/apache2 -k start
9624 www-data 268288 kB /usr/sbin/apache2 -k start
9626 www-data 268288 kB /usr/sbin/apache2 -k start
9627 www-data 268288 kB /usr/sbin/apache2 -k start
9629 www-data 268288 kB /usr/sbin/apache2 -k start
9630 www-data 268288 kB /usr/sbin/apache2 -k start
9633 www-data 268288 kB /usr/sbin/apache2 -k start
9634 www-data 268288 kB /usr/sbin/apache2 -k start
9635 www-data 268288 kB /usr/sbin/apache2 -k start
9637 www-data 268288 kB /usr/sbin/apache2 -k start
9339 www-data 268284 kB /usr/sbin/apache2 -k start
8965 www-data 268280 kB /usr/sbin/apache2 -k start
8979 www-data 268280 kB /usr/sbin/apache2 -k start
9488 www-data 268280 kB /usr/sbin/apache2 -k start
9578 www-data 268280 kB /usr/sbin/apache2 -k start
9612 www-data 268280 kB /usr/sbin/apache2 -k start
8888 www-data 268156 kB /usr/sbin/apache2 -k start
8928 www-data 268156 kB /usr/sbin/apache2 -k start
8935 www-data 268156 kB /usr/sbin/apache2 -k start
8967 www-data 268156 kB /usr/sbin/apache2 -k start
9347 www-data 268156 kB /usr/sbin/apache2 -k start
9380 www-data 268156 kB /usr/sbin/apache2 -k start
9494 www-data 268156 kB /usr/sbin/apache2 -k start
9577 www-data 268156 kB /usr/sbin/apache2 -k start
9587 www-data 268156 kB /usr/sbin/apache2 -k start
9590 www-data 268156 kB /usr/sbin/apache2 -k start
9595 www-data 268156 kB /usr/sbin/apache2 -k start
9598 www-data 268156 kB /usr/sbin/apache2 -k start
9600 www-data 268156 kB /usr/sbin/apache2 -k start
9606 www-data 268156 kB /usr/sbin/apache2 -k start
9614 www-data 268156 kB /usr/sbin/apache2 -k start
9618 www-data 268156 kB /usr/sbin/apache2 -k start
9628 www-data 268156 kB /usr/sbin/apache2 -k start
9632 www-data 268156 kB /usr/sbin/apache2 -k start
9708 www-data 268156 kB /usr/sbin/apache2 -k start
8883 root 267236 kB /usr/sbin/apache2 -k start
8909 comatel 244848 kB /usr/bin/php5-cgi
9116 comatel 244384 kB /usr/bin/php5-cgi
9435 comatel 244384 kB /usr/bin/php5-cgi
9451 comatel 244384 kB /usr/bin/php5-cgi
9479 comatel 244384 kB /usr/bin/php5-cgi
9117 comatel 244360 kB /usr/bin/php5-cgi
9255 comatel 243300 kB /usr/bin/php5-cgi
8904 comatel 243020 kB /usr/bin/php5-cgi
8947 comatel 242544 kB /usr/bin/php5-cgi
9003 comatel 242544 kB /usr/bin/php5-cgi
9007 comatel 242544 kB /usr/bin/php5-cgi
8943 comatel 242532 kB /usr/bin/php5-cgi
8907 comatel 242336 kB /usr/bin/php5-cgi
9103 comatel 242336 kB /usr/bin/php5-cgi
9352 comatel 242336 kB /usr/bin/php5-cgi
9360 comatel 242336 kB /usr/bin/php5-cgi
8949 comatel 242252 kB /usr/bin/php5-cgi
8897 comatel 242080 kB /usr/bin/php5-cgi
8944 comatel 242080 kB /usr/bin/php5-cgi
8948 comatel 242080 kB /usr/bin/php5-cgi
9004 comatel 242080 kB /usr/bin/php5-cgi
9122 comatel 242080 kB /usr/bin/php5-cgi
9126 comatel 242080 kB /usr/bin/php5-cgi
9128 comatel 242080 kB /usr/bin/php5-cgi
9324 comatel 242080 kB /usr/bin/php5-cgi
8908 comatel 241520 kB /usr/bin/php5-cgi
8919 comatel 241520 kB /usr/bin/php5-cgi
9100 comatel 241008 kB /usr/bin/php5-cgi
9254 comatel 240976 kB /usr/bin/php5-cgi
9102 comatel 240940 kB /usr/bin/php5-cgi
9251 comatel 240768 kB /usr/bin/php5-cgi
9364 comatel 240768 kB /usr/bin/php5-cgi
9274 comatel 240752 kB /usr/bin/php5-cgi
9353 comatel 240752 kB /usr/bin/php5-cgi
9101 comatel 240740 kB /usr/bin/php5-cgi
9124 comatel 240740 kB /usr/bin/php5-cgi
9270 comatel 240740 kB /usr/bin/php5-cgi
9272 comatel 240740 kB /usr/bin/php5-cgi
9322 comatel 240740 kB /usr/bin/php5-cgi
9323 comatel 240740 kB /usr/bin/php5-cgi
9363 comatel 240740 kB /usr/bin/php5-cgi
  #3 (permalink)  
Antiguo 31/08/2013, 09:17
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

CONFIGURACION DE APACHE:

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 30

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive off

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 1000

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 20
MaxClients 150
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
# graceful restart. ThreadLimit can only be changed by stopping
# and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 3000
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include all the user configurations:
Include httpd.conf

# Include ports listing
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/
NameVirtualHost 91.121.136.35:80
  #4 (permalink)  
Antiguo 31/08/2013, 09:59
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

Aporto mas información de mi sistema:

Operating system Debian Linux 6.0.6

Time on server 31/Ago/2013 18:00 , Up 0 hours, 25 minutes

Kernel and CPU Linux 3.2.13-grsec-xxxx-grs-ipv6-64 on x86_64

CPU load averages 12.02 (1 min) 12.09 (5 mins) 8.82 (15 mins)

Running processes 484

Real memory 15.57 GB total, 10.65 GB used

Virtual memory 1 GB total, 9.73 MB used

Local disk space 1.82 TB total, 309.25 GB used
  #5 (permalink)  
Antiguo 31/08/2013, 10:09
 
Fecha de Ingreso: octubre-2010
Mensajes: 374
Antigüedad: 13 años, 6 meses
Puntos: 34
Respuesta: Problema RAM y APACHE servidor dedicado

O tienes mucho tráfico o te están atacando.

Con los logs de acceso (access_log)

Y también instala apachetop


apt-get install apachetop

Luego ejecuta apachetop, espera un rato y mira cuantas peticiones tienes por segundo.

Checa las conexiones al puerto 80 netstat -n |grep :80 |wc -l
__________________
Administrador de Servidores -> yo[arroba]skamasle[puntito]com
| Debian | Centos |
| Solución de Problemas | Seguridad | Instalaciones y Configuraciones | Soluciones Anti-DDOS
  #6 (permalink)  
Antiguo 31/08/2013, 11:05
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

el apachetop me reporta esto:

last hit: 00:00:00 atop runtime: 0 days, 00:00:05 17:10:43
All: 0 reqs ( 0.0/sec) 0.0B ( 0.0B/sec) 0.0B/req
2xx: 0 ( 0.0%) 3xx: 0 ( 0.0%) 4xx: 0 ( 0.0%) 5xx: 0 ( 0.0%)
R ( 5s): 0 reqs ( 0.0/sec) 0.0B ( 0.0B/sec) 0.0B/req
2xx: 0 ( 0.0%) 3xx: 0 ( 0.0%) 4xx: 0 ( 0.0%) 5xx: 0 ( 0.0%)

y el netstat -n |grep :80 |wc -l me reporta 60 conexiones
  #7 (permalink)  
Antiguo 31/08/2013, 11:35
 
Fecha de Ingreso: octubre-2010
Mensajes: 374
Antigüedad: 13 años, 6 meses
Puntos: 34
Respuesta: Problema RAM y APACHE servidor dedicado

Cita:
Iniciado por Riderwalker Ver Mensaje
el apachetop me reporta esto:

last hit: 00:00:00 atop runtime: 0 days, 00:00:05 17:10:43
All: 0 reqs ( 0.0/sec) 0.0B ( 0.0B/sec) 0.0B/req
2xx: 0 ( 0.0%) 3xx: 0 ( 0.0%) 4xx: 0 ( 0.0%) 5xx: 0 ( 0.0%)
R ( 5s): 0 reqs ( 0.0/sec) 0.0B ( 0.0B/sec) 0.0B/req
2xx: 0 ( 0.0%) 3xx: 0 ( 0.0%) 4xx: 0 ( 0.0%) 5xx: 0 ( 0.0%)

y el netstat -n |grep :80 |wc -l me reporta 60 conexiones
Has esperado para el apache top ?

Por que aveces tarda como 15 segundos en mostrar datos, aunque no funciona si esta el log deshabilitado.

60 conexiones no son tantas para generar tantas y tomando en cuenta que no es un dato concluyente el netstat, yo diría que tienes un problema en algún script o algo te hace DOS.

Mira los logs en /var/log/apache2

Mira con este otro también aver si no es la misma IP la que genera todas las conexiones:

netstat -plan|grep :80 | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -n
__________________
Administrador de Servidores -> yo[arroba]skamasle[puntito]com
| Debian | Centos |
| Solución de Problemas | Seguridad | Instalaciones y Configuraciones | Soluciones Anti-DDOS
  #8 (permalink)  
Antiguo 31/08/2013, 12:07
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

Cita:
Iniciado por skamasle Ver Mensaje
Has esperado para el apache top ?

Por que aveces tarda como 15 segundos en mostrar datos, aunque no funciona si esta el log deshabilitado.

60 conexiones no son tantas para generar tantas y tomando en cuenta que no es un dato concluyente el netstat, yo diría que tienes un problema en algún script o algo te hace DOS.

Mira los logs en /var/log/apache2

Mira con este otro también aver si no es la misma IP la que genera todas las conexiones:

netstat -plan|grep :80 | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -n

ahora me salen 240 conexiones.

el apache server-status me muestra esto:

Apache Server Status for localhost

Server Version: Apache/2.2.16 (Debian) DAV/2 SVN/1.6.12 mod_fcgid/2.3.6 PHP/5.3.3-7+squeeze17 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.7(2010-08-16) mod_ssl/2.2.16 OpenSSL/0.9.8o
Server Built: Mar 3 2013 12:09:44
__________________________________________________ __________________________________________________ __________________________________________________ ___________________________

Current Time: Saturday, 31-Aug-2013 19:49:51 CEST
Restart Time: Saturday, 31-Aug-2013 18:43:40 CEST
Parent Server Generation: 0
Server uptime: 1 hour 6 minutes 11 seconds
Total accesses: 20342 - Total Traffic: 89.0 MB
CPU Usage: u2.32 s1.01 cu0 cs0 - .0839% CPU load
5.12 requests/sec - 22.9 kB/second - 4587 B/request
210 requests currently being processed, 37 idle workers

_WWW__WWW_WWWWWWWWW__WW_WW_WWW_WWWWW.WWWWW_WWWWWWW W_WWWWWWWW_WW_
WW_WWWWWW_W_WWWWWWW_WWWWWWW_WWWWW_WWWWWW_WWWWW_CWW W_WWWWW_WWWWWW
WWWWWWWWWWW_WWWWWRWWWWWWCWWWW_WWWW_WW_WWWWWW_WWWWW WWWWWWWWWW_WWW
WWWW_WW_WW_WWWWWW_WWWWW__W_WWWWWWWWWWWWWW.WWWWWWWW WWWWWW._......

Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process

Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request
0-0 9127 0/541/541 _ 0.39 0 54066 0.0 0.74 0.74 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
1-0 12108 0/150/502 W 0.10 509 0 0.0 0.15 0.70 198.143.130.186 comatel.net GET /content/49/phoenix-contact-parte-enchufable-corriente-nomi
2-0 15529 0/16/500 W 0.02 414 0 0.0 0.01 12.45 198.143.130.186 comatel.net GET /content/38/solera-marco-para-superficie-y-empotrar-de-85x1
3-0 17071 0/1/522 W 0.00 19 0 0.0 0.00 0.92 115.28.7.146 comatel.net GET http://www.ffu8.com/ HTTP/1.1
4-0 15530 0/14/519 _ 0.02 2 191139 0.0 0.01 0.66 157.55.35.75 comatel.net GET /content/25/disano-sirio-kit-643-led-3x16w-cld-ctl-blanco-2
5-0 14656 0/15/557 _ 0.02 0 57074 0.0 0.01 0.90 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
6-0 15531 0/7/537 W 0.00 440 0 0.0 0.00 1.05 157.55.34.35 comatel.net GET /content/112/finder-rel%C3%A9-de-potencia-653190800300 HTTP
7-0 16382 0/5/503 W 0.00 25 0 0.0 0.01 0.95 66.249.75.221 masvoltaje.com GET /simatic-s7-1200/1228-simatic-s7-1200-entrada-analogica-sm-
8-0 15704 0/9/472 W 0.01 464 0 0.0 0.01 0.87 198.143.130.186 comatel.net GET /content/49/phoenix-contact-elemento-de-sirena-7-sonidos-24
9-0 17072 0/2/510 _ 0.00 0 18473 0.0 0.01 0.98 115.28.7.146 comatel.net GET http://www.ffu8.com/ HTTP/1.1
10-0 16865 0/5/520 W 0.00 12 0 0.0 0.01 0.89 183.247.169.6 comatel.net GET http://www.660it.com HTTP/1.1
11-0 16673 0/10/503 W 0.01 38 0 0.0 0.02 0.72 198.143.130.186 comatel.net GET /content/5/schneider-electric-det-fotoelec-fun-m18-dc3h-pro
12-0 16674 0/0/516 W 0.00 247 0 0.0 0.00 1.00 198.143.130.186 comatel.net GET /content/55/secom-fijo-sin-borde-50mm-gu-10-11w-blancolamp-
13-0 16866 0/15/503 W 0.01 5 0 0.0 0.10 1.13 115.28.7.146 comatel.net GET http://www.ffu8.com/ HTTP/1.1
14-0 15535 0/9/569 W 0.01 440 0 0.0 0.03 1.28 198.143.130.186 comatel.net GET /content/61/televes-integra-terminal-de-servicios-7675 HTTP
15-0 15536 0/4/537 W 0.00 5 0 0.0 0.00 1.56 198.143.130.186 comatel.net GET /content/25/disano-413-boreale-fl-1x58-cell-blanco-21491508
16-0 15146 0/12/467 W 0.01 315 0 0.0 0.01 1.15 198.143.130.186 comatel.net GET /content/5/schneider-electric-cabeza-conmut-multifijacion-k
17-0 15537 0/4/510 W 0.00 27 0 0.0 0.01 1.03 115.28.7.146 comatel.net GET http://www.ffu8.com/ HTTP/1.1
18-0 15538 0/13/534 W 0.01 9 0 0.0 0.09 0.95 198.143.130.186 comatel.net GET /content/35/gaestopas-derivacion-en-y-rqy-ad-2x425-1x545-ne
19-0 15539 0/13/328 _ 0.03 0 46062 0.0 0.01 0.53 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
20-0 17073 0/2/281 _ 0.00 0 18021 0.0 0.00 0.40 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
21-0 15540 0/8/392 W 0.00 11 0 0.0 0.01 0.59 183.247.169.6 comatel.net GET http://www.660it.com HTTP/1.1
22-0 12111 0/175/537 W 0.14 7 0 0.0 0.25 0.89 183.247.169.6 comatel.net GET http://www.660it.com HTTP/1.1
23-0 16505 0/7/375 _ 0.00 2 35044 0.0 0.00 0.77 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
24-0 13292 0/25/357 W 0.01 294 0 0.0 0.01 0.78 157.56.92.141 comatel.net GET /content/49/phoenix-contact-placa-de-circuito-impreso-para-
25-0 15542 0/8/430 W 0.00 47 0 0.0 0.01 0.71 88.19.80.161 masvoltaje.com GET /15_televes HTTP/1.1
26-0 12113 0/181/477 _ 0.15 0 23028 0.0 0.19 0.69 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
27-0 17074 0/1/651 W 0.00 18 0 0.0 0.00 28.29 115.28.7.146 comatel.net GET http://www.ffu8.com/ HTTP/1.1
28-0 13293 0/31/289 W 0.02 420 0 0.0 0.01 0.49 198.143.130.186 comatel.net GET /content/5/schneider-electric-disp-emision-tension-48v-60hz
29-0 15543 0/6/350 W 0.01 480 0 0.0 0.01 12.33 198.143.130.186 comatel.net GET /content/55/secom-enerfi-superficie-3x54wdifusor-prismatico
30-0 13320 0/30/122 _ 0.03 0 9012 0.0 0.03 0.33 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
31-0 17075 0/1/236 W 0.00 18 0 0.0 0.00 0.76 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
32-0 13881 0/14/38 W 0.02 63 0 0.0 0.04 0.08 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
33-0 16870 0/3/36 W 0.00 25 0 0.0 0.01 0.05 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
34-0 17076 0/1/41 W 0.00 17 0 0.0 0.00 0.08 115.28.7.146 comatel.net GET http://www.ffu8.com/ HTTP/1.1
35-0 13342 0/25/25 W 0.02 41 0 0.0 0.06 0.06 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
36-0 - 0/0/34 . 0.00 0 0 0.0 0.00 0.01 ::1 ns202074.ovh.net OPTIONS * HTTP/1.0
37-0 17167 0/0/32 W 0.00 2 0 0.0 0.00 0.10 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
38-0 13406 0/20/20 W 0.02 6 0 0.0 0.04 0.04 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1
39-0 13407 0/31/31 W 0.02 5 0 0.0 0.05 0.05 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1


Y UN LARGO ETCETERA
  #9 (permalink)  
Antiguo 31/08/2013, 12:09
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

¿Es un ataque? todas esas direcciones tipo www.vcfruit.com son paginas chinas que desconozco, el servidor se me llena de miles de accesos a mysql absudos que cuando les hago kill hace que baje el numero de procesos sleep de apache
  #10 (permalink)  
Antiguo 31/08/2013, 12:39
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

ahora me aparecen 630 conexiones con netstat -n |grep :80 |wc -l
  #11 (permalink)  
Antiguo 31/08/2013, 12:41
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

estas son las ips conectadas:

root@ns202074: netstat -plan|grep :80 | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -n
1
1 113.134.34.186
1 116.59.225.65
1 14.223.190.52
1 175.42.95.16
1 178.33.217.30
1 180.76.5.66
1 180.76.5.91
1 186.79.177.49
1 188.95.106.97
1 212.5.77.131
1 216.152.245.251
1 65.55.215.245
1 66.249.75.18
1 69.171.234.113
1 91.232.96.12
2 116.16.26.62
2 60.247.92.242
3 95.211.238.110
4 1.93.49.108
7 201.214.103.217
7 79.154.10.33
19 192.154.105.132
66 23.104.24.6
104 183.247.169.6
116 198.143.130.186
184 219.235.5.102
211 115.28.7.146
  #12 (permalink)  
Antiguo 31/08/2013, 15:50
 
Fecha de Ingreso: octubre-2010
Mensajes: 374
Antigüedad: 13 años, 6 meses
Puntos: 34
Respuesta: Problema RAM y APACHE servidor dedicado

Umm parece que que alguien intenta acceder a una web que había antes en ese servidor y las dns le siguen apuntando al tuyo o bien solo un ataque.

Puedes instalar dos-deflate para que bloque automáticamente esas ips o bien darles un ban con iptables a las que tengan más conexiones o las que más peticiones hagan.

Por ejemplo:

iptables -A INPUT -s 115.28.7.146 -j DROP
219.235.5.102
iptables -A INPUT -s 219.235.5.102 -j DROP

Y así que con las ips que tengan más de 50 conexiones, igual verifica antes que no sean de google con whois o alguna otra herramienta.

Hay bots chinos que hacen esto seguido hay otros que comienzan a descargar un archivo cientas de veces y colapsan el server.
__________________
Administrador de Servidores -> yo[arroba]skamasle[puntito]com
| Debian | Centos |
| Solución de Problemas | Seguridad | Instalaciones y Configuraciones | Soluciones Anti-DDOS
  #13 (permalink)  
Antiguo 01/09/2013, 04:29
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

tras bloquear todas las ips sospechosas de mas de 200 peticiones y tras funcionar todo correctamente durante 2 horas me he quedado sin acceso al servidor, no puedo acceder ni por ssh, ni por putty ni por el virtualmin... he reiniciado varias veces y nada... eso si... desde el manager de OVH me marca que tengo 520 procesos en sleep.
  #14 (permalink)  
Antiguo 01/09/2013, 07:12
 
Fecha de Ingreso: octubre-2010
Mensajes: 374
Antigüedad: 13 años, 6 meses
Puntos: 34
Respuesta: Problema RAM y APACHE servidor dedicado

Cita:
Iniciado por Riderwalker Ver Mensaje
tras bloquear todas las ips sospechosas de mas de 200 peticiones y tras funcionar todo correctamente durante 2 horas me he quedado sin acceso al servidor, no puedo acceder ni por ssh, ni por putty ni por el virtualmin... he reiniciado varias veces y nada... eso si... desde el manager de OVH me marca que tengo 520 procesos en sleep.

No puedes acceder al SSH solo o a la web tampoco ?

No habrás bloqueado tu propia ip o paso de la nada ?

Igual si has reiniciado deberían haberse borrado las entradas del iptables que has añadido con el comando que te di.

Sería que pruebes con otra IP a ver si te baneo a ti.

Y bueno si quieres gestionarlo todo de modo más sencillo puedes instalar webmin y CSF, así tendrás un firewall gráfico y podrás configurarlo para que bloquee los accesos automáticamente.
__________________
Administrador de Servidores -> yo[arroba]skamasle[puntito]com
| Debian | Centos |
| Solución de Problemas | Seguridad | Instalaciones y Configuraciones | Soluciones Anti-DDOS
  #15 (permalink)  
Antiguo 01/09/2013, 12:44
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema RAM y APACHE servidor dedicado

Cita:
Iniciado por skamasle Ver Mensaje
No puedes acceder al SSH solo o a la web tampoco ?

No habrás bloqueado tu propia ip o paso de la nada ?

Igual si has reiniciado deberían haberse borrado las entradas del iptables que has añadido con el comando que te di.

Sería que pruebes con otra IP a ver si te baneo a ti.

Y bueno si quieres gestionarlo todo de modo más sencillo puedes instalar webmin y CSF, así tendrás un firewall gráfico y podrás configurarlo para que bloquee los accesos automáticamente.
buenas, a lo largo del dia recuperé el acceso al servidor a base de reinicios, efectivamente utilizo webmin + CSF en mi servidor para administrarlo mas comodamente.

No banee mi ip, al parecer estaba muy muy sobrecargado.

Sospecho que el problema viniese de una vulnerabilidad del nucleo de drupal que puede que estuviese aprovechando una botnet...

Ahora mismo el servidor se encuentra estable desde hace 3 horas, con unicamente 180 instancias de apache en sleep y 20 conexiones activas en el netstat.

lo que se me hace extraño es que en el server-status de apache sigo viendo de vez en cuando algo como esto:

75-0 13668 0/25/25 _ 0.04 0 64097 0.0 0.02 0.02 219.235.5.102 comatel.net GET http://www.vcfruit.com HTTP/1.1

¿Eso que quiere decir? ¿Que la ip 219.235.5.102 está conectada a comatel.net y ha solicitado una conexion a http://www.vcfruit.com a través de mi apache?

Saludos
  #16 (permalink)  
Antiguo 01/09/2013, 19:18
 
Fecha de Ingreso: octubre-2010
Mensajes: 374
Antigüedad: 13 años, 6 meses
Puntos: 34
Respuesta: Problema RAM y APACHE servidor dedicado

Esos quiere decir que la ip 219.235.5.102 esta haciendo un get a vcfruit.com, aveces pasan estas cosas, los bots hacen get a los dominios que antes estaban en esa IP o sea la tuya, por que no refrescan o por que guardan la ip y no actualizan las DNS o por cualquier otro motivo o simplemente es alguien que te quiere joder.

Dale un ban a la IP y listo.
__________________
Administrador de Servidores -> yo[arroba]skamasle[puntito]com
| Debian | Centos |
| Solución de Problemas | Seguridad | Instalaciones y Configuraciones | Soluciones Anti-DDOS
  #17 (permalink)  
Antiguo 04/09/2013, 07:06
Avatar de oscarenzo  
Fecha de Ingreso: julio-2007
Ubicación: Barcelona
Mensajes: 167
Antigüedad: 16 años, 9 meses
Puntos: 2
Respuesta: Problema RAM y APACHE servidor dedicado

Va a ser que si, prueba corriendo este comando:

netstat -n | grep :80 |wc -l

Mira cuentas conexiones hay y de que IP es, por otro lado si tienes algun firewall instalado o usa iptables para bloquear la IP que hace las consultas que sobre-cargan el servidor, si ves que para, entonces te has librado de por forma temporal del ataque :D

Suerte!
__________________
Corpresa Hosting - Promociones vigentes - Hacemos Hosting Profesional - Servidores VPS, Cloud y Dedicados.
  #18 (permalink)  
Antiguo 04/09/2013, 07:59
 
Fecha de Ingreso: octubre-2010
Mensajes: 374
Antigüedad: 13 años, 6 meses
Puntos: 34
Respuesta: Problema RAM y APACHE servidor dedicado

Cita:
Iniciado por oscarenzo Ver Mensaje
Va a ser que si, prueba corriendo este comando:

netstat -n | grep :80 |wc -l

Mira cuentas conexiones hay y de que IP es, por otro lado si tienes algun firewall instalado o usa iptables para bloquear la IP que hace las consultas que sobre-cargan el servidor, si ves que para, entonces te has librado de por forma temporal del ataque :D

Suerte!
No has llegado a leer ni el quinto mensaje :/
__________________
Administrador de Servidores -> yo[arroba]skamasle[puntito]com
| Debian | Centos |
| Solución de Problemas | Seguridad | Instalaciones y Configuraciones | Soluciones Anti-DDOS
  #19 (permalink)  
Antiguo 04/09/2013, 08:43
Avatar de oscarenzo  
Fecha de Ingreso: julio-2007
Ubicación: Barcelona
Mensajes: 167
Antigüedad: 16 años, 9 meses
Puntos: 2
Respuesta: Problema RAM y APACHE servidor dedicado

Cita:
Iniciado por skamasle Ver Mensaje
No has llegado a leer ni el quinto mensaje :/
En concreto no me percate de esto:

"Esos quiere decir que la ip 219.235.5.102 esta haciendo un get a vcfruit.com, aveces pasan estas cosas, los bots hacen get a los dominios que antes estaban en esa IP o sea la tuya, por que no refrescan o por que guardan la ip y no actualizan las DNS o por cualquier otro motivo o simplemente es alguien que te quiere joder.

Dale un ban a la IP y listo."

Una aportación más si es efectiva, creo que no esta de más.

Saludillos :D
__________________
Corpresa Hosting - Promociones vigentes - Hacemos Hosting Profesional - Servidores VPS, Cloud y Dedicados.

Etiquetas: apache, correo, dedicado, ram, servidor, servidores-web
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:17.