LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache 2.2 issue, plus zombie process (https://www.linuxquestions.org/questions/linux-software-2/apache-2-2-issue-plus-zombie-process-449841/)

ZoolWay 05-30-2006 05:30 AM

Apache 2.2 issue, plus zombie process
 
Hi out there,

I am having a problem with my apache webserver which started a few weeks ago.

Issues:
- Every few hours the servers stops to work/send data. If you open a page in firefox he does not stop to load but shows up nothing. It seems you can nearly wait until the end of time. Restarting the service with an "rcapache graceful" cures the problem immediatley and pages get loaded as supposed to be. During this problem there is not special cpu load even httpd itself has 1% cpu load or less.
- When I first encountered this problem I discovered an zombie process which I did not see before in the past. Because of this I think it may have to do something with the main problem. While apache runs (while working and while having the problem stated above) top shows a zombie process, labeld with "sh <defunct>". The PID of that process keeps changing so I think it is quiting and forking the whole time. This process does not take more than 1% CPU load.

Here you can see what top shows me:
Code:

top - 09:29:43 up 3 days, 13:37,  1 user,  load average: 0.01, 0.08, 0.08
Tasks:  69 total,  1 running,  67 sleeping,  0 stopped,  1 zombie
Cpu(s):  2.3% us,  1.7% sy,  0.0% ni, 96.0% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:  1024004k total,  767268k used,  256736k free,  120320k buffers
Swap:  2047992k total,    28484k used,  2019508k free,  402364k cached

  PID  PPID    TIME+  %CPU %MEM  PR  NI S  VIRT SWAP  RES  UID COMMAND
12198  1579  0:00.03  1.0  0.0  24  0 Z    0    0    0    0 sh <defunct>
12124 11415  0:00.57  0.7  0.1  21  0 R  1856 1020  836    0 top
11407  2172  0:01.18  0.3  0.2  20  0 S  7384 5428 1956    0 sshd
    1    0  0:01.94  0.0  0.0  20  0 S  1556 1072  484    0 init
    2    1  0:00.00  0.0  0.0  RT  0 S    0    0    0    0 migration/0
    3    1  0:00.00  0.0  0.0  39  19 S    0    0    0    0 ksoftirqd/0
    4    1  0:00.00  0.0  0.0  15  -5 S    0    0    0    0 events/0
    5    1  0:00.00  0.0  0.0  15  -5 S    0    0    0    0 khelper
    6    1  0:00.00  0.0  0.0  15  -5 S    0    0    0    0 kthread
    8    6  0:00.00  0.0  0.0  15  -5 S    0    0    0    0 kblockd/0
  11    6  0:00.00  0.0  0.0  15  -5 S    0    0    0    0 khubd
  46    1  0:00.01  0.0  0.0  20  0 S    0    0    0    0 kapmd
  142    6  0:00.00  0.0  0.0  20  0 S    0    0    0    0 pdflush
  143    6  0:00.07  0.0  0.0  20  0 S    0    0    0    0 pdflush
  145    6  0:00.15  0.0  0.0  39  19 S    0    0    0    0 kprefetchd
  144    1  0:02.25  0.0  0.0  21  0 S    0    0    0    0 kswapd0
  146    6  0:00.00  0.0  0.0  15  -5 S    0    0    0    0 aio/0

The server is running kernel 2.6.14-cks5-rb1 (bases on 2.6.14-cks5 with some changes by me to make it smaller) with SMP support.
After first encountering this problem I upgraded the Apache HTTPD from 2.2.0 to 2.2.2 without anything come out. At the moment it also runs PHP version 5.1.4. Though it has no problem the machine also runs a MySQL server version 5.0.18.

This is the stripped httpd.conf:
Code:

ServerRoot "/server/bin/apache2"
<IfModule !mpm_winnt.c>
<IfModule !mpm_netware.c>
</IfModule>
</IfModule>
<IfModule !mpm_netware.c>
<IfModule !perchild.c>
</IfModule>
</IfModule>
<IfModule !mpm_netware.c>
PidFile logs/httpd.pid
</IfModule>
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers        5
MinSpareServers      5
MaxSpareServers    10
MaxClients        150
MaxRequestsPerChild  0
</IfModule>
<IfModule worker.c>
StartServers        2
MaxClients        150
MinSpareThreads    25
MaxSpareThreads    75
ThreadsPerChild    25
MaxRequestsPerChild  0
</IfModule>
<IfModule perchild.c>
NumServers          5
StartThreads        5
MinSpareThreads      5
MaxSpareThreads    10
MaxThreadsPerChild  20
MaxRequestsPerChild  0
</IfModule>
Listen 80
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
LoadModule dav_module modules/mod_dav.so
LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .leo .php
ExtendedStatus On
TransferLog "|./rotatelogs /var/log/httpd/httpd 5M"
<IfModule !mpm_winnt.c>
<IfModule !mpm_netware.c>
User httpd
Group #-1
</IfModule>
</IfModule>
ServerAdmin meinname@domain.de
UseCanonicalName Off
DocumentRoot "/server/data/intranet"
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/server/data/intranet">
    Options FollowSymLinks
    AllowOverride AuthConfig FileInfo
    Order deny,allow
    Deny from all
    Allow from domain.local
    Allow from 192.168.200
    Allow from 192.168.100
</Directory>
UserDir public_html
DirectoryIndex index.leo index.php index.html index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog logs/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combine                                                                              d
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common
ServerTokens Full
ServerSignature EMail
Alias /icons/ "/server/bin/apache2/icons/"
<Directory "/server/bin/apache2/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/server/bin/apache2/ma                                                                              nual$1"
<Directory "/server/bin/apache2/manual">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
    <Files *.html>
        SetHandler type-map
    </Files>
    SetEnvIf Request_URI ^/manual/de/ prefer-language=de
    SetEnvIf Request_URI ^/manual/en/ prefer-language=en
    SetEnvIf Request_URI ^/manual/es/ prefer-language=es
    SetEnvIf Request_URI ^/manual/fr/ prefer-language=fr
    SetEnvIf Request_URI ^/manual/ja/ prefer-language=ja
    SetEnvIf Request_URI ^/manual/ko/ prefer-language=ko
    SetEnvIf Request_URI ^/manual/ru/ prefer-language=ru
    RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$                                                                              2
</Directory>
ScriptAlias /cgi-bin/ "/server/bin/apache2/cgi-bin/"
<IfModule mod_cgid.c>
</IfModule>
<Directory "/server/bin/apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt                                                                              pt-BR ru sv zh-CN zh-TW
ForceLanguagePriority Prefer Fallback
AddDefaultCharset ISO-8859-1
AddCharset ISO-8859-1  .iso8859-1  .latin1
AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
AddCharset ISO-8859-3  .iso8859-3  .latin3
AddCharset ISO-8859-4  .iso8859-4  .latin4
AddCharset ISO-8859-5  .iso8859-5  .latin5 .cyr .iso-ru
AddCharset ISO-8859-6  .iso8859-6  .latin6 .arb
AddCharset ISO-8859-7  .iso8859-7  .latin7 .grk
AddCharset ISO-8859-8  .iso8859-8  .latin8 .heb
AddCharset ISO-8859-9  .iso8859-9  .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5        .Big5      .big5
AddCharset WINDOWS-1251 .cp-1251  .win-1251
AddCharset CP866      .cp866
AddCharset KOI8-r      .koi8-r .koi8-ru
AddCharset KOI8-ru    .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8      .utf8
AddCharset GB2312      .gb2312 .gb
AddCharset utf-7      .utf7
AddCharset utf-8      .utf8
AddCharset big5        .big5 .b5
AddCharset EUC-TW      .euc-tw
AddCharset EUC-JP      .euc-jp
AddCharset EUC-KR      .euc-kr
AddCharset shift_jis  .sjis
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler type-map var
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-caref                                                                              ully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from All
    Allow from localhost
    Allow from 192.168.200.101
    Allow from intranet
    Allow from intranet.domain.local
    Allow from .domain.local
</Location>
<IfModule mod_ssl.c>
    Include conf/ssl.conf
</IfModule>

It would be nice to hear if all these zombie processes (only one at a time) are normal. And if anyone has an idea how I can go back to run the web server without a "rcapache graceful" scheduled every hour.
Before anyone asks what I changed on the system when the problem began: I only made some changes in some php script, not the server software itself. That was upgraded first after I encountered these problems.

Any hint would be appreciated!

Best regards,
- ZoolWay

ZoolWay 05-31-2006 06:43 AM

A user in another forum found I problem. I am posting because maybe someone will find this thread with the same problem:
In the TransferLog directive rotatelog was not configured properly, it was not found by apache. After correcting this now the zombie has gone and I did not encounter the main problem.

zeitounator 05-31-2006 06:46 AM

Thanks for sharing !
Can you please post the link of the other thread ?

lionslair 12-26-2006 07:41 AM

apache2
 
Can you post the link to the other thread. I have this same problem also I think, However it has only come back in the last week or so. After I upped the Ram a while ago it went away but has again returned. I have gone through all my logs and read all these apache tuning docs so will wait for the reply of this link.

Thanks.

pkhunter 08-19-2009 09:07 PM

I have the same problem. But I don't have the "TransferLog" directive at all! In fact I do not wish to do any logging. Is this a reason I have "585 sleeping" and "25 zombie" processes?


All times are GMT -5. The time now is 03:08 PM.