Re: Overscheduling DOES happen with high web server load.

Andi Kleen (ak@muc.de)
Thu, 6 May 1999 07:38:11 +0200


>Why don't we see the time taken by the goodness() function?

Because goodness() is inline.

>
>> Apache has a fairly even cycle distribution, but in the kernel, 'schedule'
>> really sticks out as the CPU burner.
>>
>> I think that the linear search for next runnable process is where time is
>> being spent.
>
>Could well be, especially if the context switches are happening
>between threads rather than separate processes. Thread switches are
>*really* fast under Linux.

??? current apache doesn't use threads, it uses processes.

As a wild guess of the cause: AFAIK apache uses multiple processes
in a accept() on a single socket (please correct me if I'm wrong, it has
been a long time since I last looked at apache source). accept() always
wakes up all processes waiting on the socket when an event occurs. Some
people speculated that this could cause the thundering herd problem, it
is possible that these benchmarks gave the first proof of this problem.
The long run queues are a strong cue in this direction.

Fix would be to do a special version of wake_up() that only wakes up
the first waiter and use that in the TCP socket data ready call backs.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/