Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22
Hi, I have compiled and installed httpd version 2.0.48 on a server and everymorning i see many httpd processes. These processes take CPU equalpercentage among themselves and make the processor ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    132

    Many httpd processes


    Hi,
    I have compiled and installed httpd version 2.0.48 on a server and everymorning i see many httpd processes. These processes take CPU equalpercentage among themselves and make the processor 100% busy. Thus slowing down the server. When i stop and start the server theseprocesses go away. This happens every morning and otherwise the webserver works fine. Is there a way to automatically kill/stop these unwanted processes?
    How to do this from the configuration file?
    I have the following settings and errors
    //
    <IfModule prefork.c>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 150
    MaxRequestsPerChild 100
    </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>
    \\
    From error.log(many such errors/warnings about child processes during service httpd restart):
    //[Fri Feb 27 08:03:07 2004] [warn] child process 20944 still did notexit, sending a SIGTERM
    [Fri Feb 27 08:03:07 2004] [warn] child process 20974 still did notexit, sending a SIGTERM
    [Fri Feb 27 08:03:07 2004] [warn] child process 21051 still did notexit, sending a SIGTERM
    [Fri Feb 27 08:03:08 2004] [notice] caught SIGTERM, shutting down
    [Fri Feb 27 08:03:34 2004] [notice] Digest: generating secret for digest authentication ...
    [Fri Feb 27 08:03:34 2004] [notice] Digest: done
    [Fri Feb 27 08:03:35 2004] [notice] Apache/2.0.48 (Unix) configured --resuming normal operations
    \\
    Also there are total 25 such processes.Have i done any misconfiguration? I have also tried recompilation but it did not help.I used "./configure --enable-mods-shared=all --enable-ssl"I have compiled this version on other machines but such error never occurred. Any suggestions will help . Thank you.
    -- Anand.
    You are the one Linux!

  2. #2
    Linux User
    Join Date
    May 2003
    Location
    CA
    Posts
    370
    there is a way to kill/stop the unwanted processes but for doing that you would have to know the exact pid's of all the processes which I guess is not possible since they would change from day to day. You might want to see why there are 25 processes running...on my machine I have one parent process and 8 child processes running...its strange that you get so many processes only in the mornings...did you try a different version of apache 1.x perhaps?
    Fixing Unix is better than working with Windows.
    http://nikhilk.homedns.org/projects/index.html

  3. #3
    Linux Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    132
    Hi Nikhil,
    The httpd version which i have installed is one of the stable versions and i have tried it on other servers also. I cannot try 1.3 version (v/s 2.x) currently since its of the different breed right? I am puzzled about the processes which remain and does not die out. Even the method of 'kill'ing the processes is not wise right? I wanted that the unwanted processes should perish automatically.
    Thank you.
    You are the one Linux!

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Apache is supposed to have several processes (it keeps a number of worker threads). However, they are clearly not supposed to take up your CPU all the time. Try stracing one of them to try and find out what they're doing with their cycles.

  5. #5
    Linux Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    132
    Hi,
    Regarding the "Many http processes"
    I am new to debugging i tried the following:
    Code:
    ----------------- top o/p
    22617 apache    15   0 15184  14M  5960 S     0,0  2,9   0&#58;03   0 httpd
    22618 apache    15   0 13668  13M  5948 S     0,0  2,6   0&#58;01   0 httpd
    22619 apache    15   0 10152 9,9M  5564 S     0,0  1,9   0&#58;00   0 httpd
    22620 apache    15   0  8924 8924  5568 S     0,0  1,7   0&#58;00   0 httpd
    22621 apache    15   0 13440  13M  5896 S     0,0  2,6   0&#58;00   0 httpd
    22624 apache    15   0 10348  10M  5596 S     0,0  2,0   0&#58;00   0 httpd
    22625 apache    15   0 10504  10M  5724 S     0,0  2,0   0&#58;00   0 httpd
    22626 apache    15   0 10404  10M  5656 S     0,0  2,0   0&#58;00   0 httpd
    22790 apache    15   0  8056 8056  5060 S     0,0  1,5   0&#58;00   0 httpd
    ------------------ top o/p end
    Code:
    -----------------I got the following o/p for strace
    &#91;root@test root&#93;# strace -p 22790
    trace&#58; ptrace&#40;PTRACE_SYSCALL, ...&#41;&#58; Operation not permitted
    detach&#58; ptrace&#40;PTRACE_DETACH, ...&#41;&#58; Operation not permitted
    ---------------
    Was this expected ? apache was running normally when i tried this. Please help !

    Mod edit: added code tags.
    You are the one Linux!

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    No, that was not expected...

    However, I can't see that those processes are actually doing the bad things that you described. If this is indeed a top output, then they aren't consuming any CPU cycles at all. Does the thing that you described happen often?

  7. #7
    Linux User
    Join Date
    May 2003
    Location
    CA
    Posts
    370
    yeah...%CPU shows 0.0...so its not consuming cpu at all....maybe its something else thats eating up your cpu cycles!!
    Fixing Unix is better than working with Windows.
    http://nikhilk.homedns.org/projects/index.html

  8. #8
    Linux Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    132
    Apache was running normally when i tried strace!
    You are the one Linux!

  9. #9
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, in that case I don't see the problem. You said that those processes were taking up the entire CPU, while in fact they aren't. Would you mind clarifying that?

  10. #10
    Linux Newbie
    Join Date
    Feb 2004
    Location
    India
    Posts
    132
    This morning the status was like this!
    Code:
    ----------------------top&#58;
    31288 apache    25   0  6860 6304  2464 R     7,9  1,2   8&#58;11   0 httpd
    31618 apache    25   0  5848 5280  2340 R     7,9  1,0   5&#58;51   0 httpd
    31639 apache    25   0  6744 6188  2476 R     7,9  1,2   3&#58;16   0 httpd
    31652 apache    25   0  5860 5292  2340 R     7,9  1,0   4&#58;05   0 httpd
    31549 apache    25   0  8456 7684  2472 R     7,1  1,4   2&#58;41   0 httpd
    31290 apache    25   0  6776 6220  2400 R     6,5  1,2   9&#58;31   0 httpd
    31286 apache    25   0  6692 6136  2396 R     5,9  1,1  24&#58;12   0 httpd
    31287 apache    25   0  6724 6168  2432 R     5,9  1,2  13&#58;46   0 httpd
    31289 apache    25   0  5932 5364  2360 R     5,9  1,0  17&#58;51   0 httpd
    31514 apache    25   0  6648 5972  2400 R     5,9  1,1   4&#58;50   0 httpd
    31551 apache    25   0  6704 5620  2388 R     5,9  1,0  11&#58;33   0 httpd
    31651 apache    25   0  7020 6184  2808 R     5,9  1,2   1&#58;30   0 httpd
    31675 apache    25   0  7492 6848  3112 R     5,9  1,3   0&#58;54   0 httpd
    31803 apache    25   0  6084 5516  2564 R     5,9  1,0   1&#58;59   0 httpd
    31861 apache    25   0  6952 6384  3444 R     5,9  1,2   0&#58;27   0 httpd
    31616 apache    15   0  7352 6796  3148 S     0,0  1,3   0&#58;00   0 httpd
    31658 apache    15   0  9696 9092  3812 S     0,0  1,7   0&#58;00   0 httpd
    31796 apache    15   0  9516 8960  3544 S     0,0  1,7   0&#58;00   0 httpd
    31804 apache    15   0  7584 7028  3192 S     0,0  1,3   0&#58;00   0 httpd
    31805 apache    15   0  7524 6968  3284 S     0,0  1,3   0&#58;00   0 httpd
    31860 apache    15   0  5848 5276  2716 S     0,0  1,0   0&#58;00   0 httpd
    31862 apache    15   0  5928 5356  2748 S     0,0  1,0   0&#58;00   0 httpd
    31539 apache    25   0  6736 6172  2396 T     0,0  1,2   6&#58;39   0 httpd
    --------------------------
    Thus cpu was 0 % free
    Code:
    --------------------------
    
    &#91;root@test root&#93;# strace -p 31286
    trace&#58; ptrace&#40;PTRACE_SYSCALL, ...&#41;&#58; Operation not permitted
    detach&#58; ptrace&#40;PTRACE_DETACH, ...&#41;&#58; Operation not permitted
    &#91;root@test root&#93;# 
    --------------------------
    Please tell me what can i do now?
    Is there a problem in apache? or i tried the wrong command?
    Thank you
    You are the one Linux!

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •