Centos5 reportando que está ficando sem memória

1

Eu continuo recebendo um problema de memória no CENTOS5, que é o meu servidor web.

 -bash: fork: Cannot allocate memory

Nas páginas do meu site eu recebo ...

 Can't create a new thread (errno 12); if you are not out of available memory, you can 
 consult the   manual for a possible OS-dependent bug in /opt/lampp/htdocs/toplogin.php on line 36
 Could not connect: Can't create a new thread (errno 12); if you are not out of 
 available memory,  you can consult the manual for a possible OS-dependent bug

Eu tenho 4 GB de memória, não uma tonelada de tráfego, não sei o que diabos está acontecendo ...

 [root@s15433245 lampp]# ps aux
 USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
 root         1  0.0  0.0  10364   748 ?        Ss   Aug03   0:16 init [3]
 postfix   1470  0.0  0.0  54224  2360 ?        S    Aug03   0:00 tlsmgr -l -t unix -u
 root      6029  0.0  0.0  46140  4184 ?        SLs  Aug31   0:00 proftpd: 74.84.118.99:3419:       USER userftp
 root     11890  0.0  0.4  69480 18808 ?        Ss   Sep02   1:50 /opt/lampp/bin/httpd -k start   -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 root     11910  0.0  0.0   9984  1412 ?        S    Sep02   0:00 /bin/sh /opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql --pid-file=/opt/lampp/var/mysql/s15433245.onli
 nobody   12177  0.0  0.3  48940 12772 ?        S    Sep02   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   12272  0.3  0.8 215536 34452 ?        Sl   Sep02  65:28 /opt/lampp/sbin/mysqld --basedir=/opt/lampp --datadir=/opt/lampp/var/mysql --plugin-dir=/opt/lampp/lib/mysql/plu
 root     13931  0.0  0.0  96588  3796 ?        Ss   08:00   0:00 sshd: root@pts/0
 root     13933  0.0  0.0  12212  1788 pts/0    Ss   08:00   0:00 -bash
 root     16321  0.0  0.0  46140  4184 ?        SLs  Sep08   0:00 proftpd: 74.84.118.99:6751: USER userftp
 root     16322  0.0  0.0  46144  4184 ?        SLs  Sep08   0:00 proftpd: 74.84.118.99:6761: USER userftp
 root     16342  0.0  0.0  46140  4184 ?        SLs  Sep08   0:00 proftpd: 74.84.118.99:6782: USER userftp
 root     16345  0.0  0.0  46136  4180 ?        SLs  Aug19   0:00 proftpd: 75.5.72.144:52094: USER userftp
 root     16346  0.0  0.0  46136  4180 ?        SLs  Aug19   0:00 proftpd: 75.5.72.144:52115: USER userftp
 root     17440  0.0  0.0  12780   772 ?        S<s  Aug03   0:00 /sbin/udevd -d
 root     17557  0.0  0.0  46136  4184 ?        SLs  Aug15   0:00 proftpd: 74.84.118.99:4172: USER userftp
 root     17559  0.0  0.0  46132  4184 ?        SLs  Aug15   0:00 proftpd: 74.84.118.99:4195: USER userftp
 nobody   19502  0.2  0.4  69984 17280 ?        S    13:56   0:01 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 root     19644  0.0  0.0   5924   624 ?        Ss   Aug03   0:52 syslogd -m 0
 root     21647  0.0  0.0  46132  4184 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:4128: USER userftp
 root     21648  0.0  0.0  46136  4188 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:4140: USER userftp
  root     21749  0.0  0.0  46136  4188 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:4206: USER userftp
  root     21756  0.0  0.0  46136  4188 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:4234: USER userftp
  root     22095  0.0  0.0  46132  4184 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:4805: USER userftp
  root     22126  0.0  0.0  46136  4188 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:4892: USER userftp
  root     23670  0.0  0.0  46128  4176 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:6703: USER userftp
  root     23912  0.0  0.0  46132  4180 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:6988: USER userftp
  root     23914  0.0  0.0  46128  4176 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:1365: USER userftp
  root     24011  0.0  0.0  46132  4180 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:1396: USER userftp
 root     24015  0.0  0.0  46132  4180 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:1421: USER userftp
 root     24033  0.0  0.0  46136  4184 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:1438: USER userftp
 root     25900  0.0  0.0  46136  4180 ?        SLs  Aug23   0:00 proftpd: 74.84.118.99:34857: USER userftp
 root     26130  0.0  0.0  46140  4184 ?        SLs  Aug23   0:00 proftpd: 74.84.118.99:34873: USER userftp
 root     26262  0.0  0.0  46144  4188 ?        SLs  Aug23   0:00 proftpd: 74.84.118.99:34880: USER userftp
nobody   28389  0.3  0.4  70152 17416 ?        S    13:43   0:04 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 root     28399  0.0  0.0  62640  1208 ?        Ss   Aug03   1:24 /usr/sbin/sshd
 root     30128  0.0  0.0  54164  2304 ?        Ss   Aug03   0:57 /usr/libexec/postfix/master
 postfix  30153  0.0  0.0  54412  2432 ?        S    Aug03   0:06 qmgr -l -t fifo -u
 postfix  30231  0.0  0.0  54228  2264 ?        S    14:02   0:00 pickup -l -t fifo -u -c -o content_filter smtp:127.0.0.1:10027
 root     30257  0.0  0.0  20888  1188 ?        Ss   Aug03   0:15 crond
 root     30268  0.0  0.0  46752   812 ?        Ss   Aug03   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
 root     30281  0.0  0.0  46752   540 ?        S    Aug03   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
root     30324  0.0  0.0  46136  4180 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:2005: USER userftp
 root     30462  0.0  0.0  46136  4184 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:2015: USER userftp
root     30466  0.0  0.0  46136  4184 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:2083: USER userftp
 root     30471  0.0  0.0  45352  3228 ?        Ss   Aug16   0:00 proftpd: 74.84.118.99:2118: USER userftp
 root     30478  0.0  0.0  46136  4184 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:2196: USER userftp
 root     30479  0.0  0.0  46132  4180 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:2249: USER userftp
 root     30485  0.0  0.0  46132  4180 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:2566: USER userftp
 root     30503  0.0  0.0  46140  4188 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:8057: USER userftp
 root     30554  0.0  0.0  46132  4184 ?        SLs  Aug12   0:00 proftpd: 74.84.118.99:3931: USER userftp
 root     30580  0.0  0.0  46128  4180 ?        SLs  Aug12   0:00 proftpd: 74.84.118.99:3994: USER userftp
 root     30683  0.0  0.0  46012  3984 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:8751: USER userftp
 root     31775  0.0  0.0  46012  3980 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:9220: USER userftp
 root     31778  0.0  0.0  46016  3984 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:9247: USER userftp
root     31781  0.0  0.0  46012  3980 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:9266: USER root
root     31784  0.0  0.0  46016  3984 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:9278: USER userftp
 root     31812  0.0  0.0  46012  3980 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:9355: USER root
 root     31831  0.0  0.0  46012  3980 ?        SLs  Aug16   0:00 proftpd: 74.84.118.99:9374: USER root
 root     31967  0.0  0.0  46140  4184 ?        SLs  Aug30   0:00 proftpd: 74.84.118.99:23694: USER userftp
 nobody   31988  0.0  0.4  69852 17088 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32019  0.0  0.4  69852 17084 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32020  0.0  0.3  69480 15532 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32023  0.0  0.4  69888 17244 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32039  0.0  0.4  69852 16968 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32041  0.0  0.3  69480 15524 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32044  0.0  0.3  69480 15536 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32063  0.0  0.4  69852 17156 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32066  0.0  0.4  69852 16960 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32067  0.0  0.4  70120 17260 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32068  0.0  0.4  70120 16968 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32070  0.0  0.4  70120 17224 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32099  0.0  0.4  69744 17344 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
  nobody   32101  0.0  0.3  69612 15612 ?        S    14:03   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
  nobody   32115  0.0  0.3  69480 15500 ?        S    14:07   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
  nobody   32116  0.0  0.3  69480 15500 ?        S    14:07   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
  nobody   32117  0.0  0.0      0     0 ?        Z    14:07   0:00 [httpd] <defunct>
  nobody   32118  0.0  0.3  69480 15516 ?        S    14:07   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 nobody   32120  0.0  0.3  69480 15496 ?        S    14:07   0:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5 -E /opt/lampp/logs/error_log
 root     32122  0.0  0.0  10740   992 pts/0    R+   14:07   0:00 ps aux
  root     32512  0.0  0.0  21660   984 ?        Ss   Aug16   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid

Uso de memes

 free -m
               total       used       free     shared    buffers     cached
 Mem:          4096        362       3733          0          0          0
 -/+ buffers/cache:        362       3733

Apenas peguei isso nos meus registros.

 Request exceeded the limit of 10 internal redirects due to probable configuration error. Use       'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.




 core file size          (blocks, -c) 0
 data seg size           (kbytes, -d) unlimited
 scheduling priority             (-e) 0
 file size               (blocks, -f) unlimited
 pending signals                 (-i) 138240
 max locked memory       (kbytes, -l) 32
 max memory size         (kbytes, -m) unlimited
 open files                      (-n) 1024
 pipe size            (512 bytes, -p) 8
 POSIX message queues     (bytes, -q) 819200
 real-time priority              (-r) 0
 stack size              (kbytes, -s) 10240
 cpu time               (seconds, -t) unlimited
 max user processes              (-u) 138240
 virtual memory          (kbytes, -v) unlimited
 file locks                      (-x) unlimited
    
por Andrew Threadgill 15.09.2011 / 21:45

1 resposta

1

ulimit -a mostrará as limitações de recursos impostas aos seus processos. Se você vir algo suspeito limitado, aumente o ritmo. Se você quiser postar a saída desse comando aqui, eu poderia ajudar mais. Verifique também o /etc/security/limits.conf.

Após ulimit -a saída foi postada, não acho que seja necessariamente um problema no nível do sistema operacional. você verificou suas configurações de apache / php para ver se há algum limite de memória? Os serviços da Web geralmente têm limites bastante restritos por thread, então esse é o próximo culpado que suspeito. Eu não encorajo postar todos os seus arquivos de configuração aqui, a menos que você esteja bastante confiante em relação à sua segurança, mas vá checar a documentação em busca de limites de thread / memória e esperançosamente você encontrará seu culpado.

    
por 15.09.2011 / 22:04