lkml.org 
[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.
From
Date
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "Andi" == Andi Kleen <ak@muc.de> 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
fcntl(2)....

- -JimC
- --
James H. Cloos, Jr. <http://www.jhcloos.com/cloos/public_key> 1024D/ED7DAEA6
<cloos@jhcloos.com> E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v0.9.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE3MgA2mXqfF+19rqYRAgCMAJ41uq9jsFUvGn7bMDE6qtKo1LLf6gCdEHUK
mr+G87EhMuQeeYSRXaqoCtc=
=tLbm
-----END PGP SIGNATURE-----

-
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/

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