[nSLUG] Re: httpd busy on idle machine?

Mike Spencer mspencer at tallships.ca
Thu Jun 25 03:48:34 ADT 2015

Hi Chris --

> I would suggest modifying the number of servers, number of children within
> the apache configuration...

I don't know how to do that. Maybe by inserting <RLimitNPROC>
directive in httpd.conf?  

Well, lets look at your suggestions:

>  possibly you have a memory leak?

Don't know.  How would I tell?

> what version of apache is this?

2.4.6 from the Slackware install package.

> it also couldn't hurt to spit some output on here? ie. pstree?

Ah, new one for me.  pstree shows:

     |       `-in.telnetd---tcsh---bash---emacs---bash
     |                   `-xterm-+-tcsh
     |                           |-twm
     |                           |-xclock
     |                           |-xterm---tcsh---emacs---tcsh
     |                           |-xterm---tcsh
     |                           `-xterm---tcsh---bash-+-emacs---bash
     |                                                 `-htop---strace
     |                                                 `-htop---strace

> htop?   anything like that would help I think... maybe even go so far
> as to strace the process to see if it's actually doing nothing and
> increase the logging?

htop? Another new one for me.  It appears to show something like 90
httpd processes, one belonging to root, the others to user apache.
Using the htop(1) 's' option (for strace) on the instance belonging to
root shows a steady stream of this:

   select(0, NULL, NULL, NULL, {1, 0})    = 0 (Timeout)
   waitpid(-1, 0xfbb9934, WNOHANG|WSTOPPED) = 0

about 1 per second.

Trace of some instances that belong to apache seem to be doing nothing
but some are furiously busy:

    gettimeofday({1435211835, 144305}, NULL) = 0
    gettimeofday({1435211835, nnnnnn}, NULL) = 0
    gettimeofday({1435211835, nnnnnn}, NULL) = 0
    epoll_wait(7, {}, 25, 100)

repeated very rapidly; where nnnnnn is a 6 digit number, different in
each line.  (htop seems to disable the X copy/paste function in an
xterm so I have to type data from htop.)

In htop, the instances of httpd that pop up to the top briefly show
"0.6 CPU%" compared to htop itself that holds the top spot at at 3.9%.

> bear in mind if you are running mysql in the back-end of that you
> will want to modify it's child procs as well to match the
> configurations in apache.

Not running mysql at all.  This is not a net-facing server.  The only
reason I run Apache is that I have a number of cgi-bin scripts on
localhost that I access from a home page in ~/html/.  Each fetches
some page from the net, edits it and hands it back to the browser.

And while I'm looking at the htop display, I wonder why there are
many, many instances of udevd and console-kit-daemon.  I don't even
understand what console-kit is for if I don't use KDE or similar

We're kinda pushing the limits of what I understand here and I may be
imagining a problem after one boot-up spent a loonng time starting
sendmail and resulted in sluggish behaviour once booted.  Subsequent
boots have been okay.

(OTOH, I *did* just manage to get masquerade working so the
no-serial-port laptop can reach the net from my home dialup

- Mike

Michael Spencer                  Nova Scotia, Canada       .~. 
mspencer at tallships.ca                                     /( )\
http://home.tallships.ca/mspencer/                        ^^-^^

More information about the nSLUG mailing list