[lkml]   [1999]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Overscheduling DOES happen with high web server load.
Hash: SHA1

>>>>> "Andi" == Andi Kleen <> writes:

Andi> As a wild guess of the cause: AFAIK apache uses multiple
Andi> processes in a accept() on a single socket (please correct me if
Andi> I'm wrong, it has been a long time since I last looked at apache
Andi> source).

Current versions of Apache use serialized accept on Linux. Ie, the
parent process loops using select(2) to sleep (does glibc 2.0 use
select(2) to implement sleep(3)?), one child sits in wait_for_connect
(ie in accept(2)) and the rest of the idle children sit in
posix_lock_file (ie in fcntl(2)) waiting for the accpet(2)ing child to
get woken and drop the lock. Whichever idle child gets scheduled
next would get to set a new lock and become the next to wait_for_connect.

Assuming include/linux/tasks.h is modified accordingly, you can easily
have 255 child processes: some working, one in wait_for_connect and the
rest spinning on the lock file via:

while ((ret = fcntl(lock_fd, F_SETLKW, &lock_it)) < 0 && errno == EINTR) {/**/}

As an aside, it is interesting to note that with three children and
one client making serialized GETs, the second and third children trade
off handling the requests and the first child never returns from

- -JimC
- --
James H. Cloos, Jr. <> 1024D/ED7DAEA6
<> E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6
Version: GnuPG v0.9.5 (GNU/Linux)
Comment: For info see


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:51    [W:0.158 / U:0.348 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site