Here is an strace of the static portion of the SPECWeb99 benchmark. http://www.apache.org/~gregames/strace.spec_static
This includes two keepalive connections with multiple requests on each connection, with Apache 2.0.43 running on a Red Hat 7.2 box. The number preceding the syscall is the time delta from the start of the preceding syscall; the <number> at the end is the time spent in the syscall itself. Some observations: The disk files aren't closed until the connection terminates. I assume we're using the connection pool for some file structure. It's probably not a big deal for prefork, but for a threaded MPM it could result in a lot of open files in one process. There sure are a lot of gettimeofday syscalls, often with nothing between them that can block. The cork/uncork looks less than optimal Notice that on every request we first turn off TCP_NODELAY, turn on TCP_CORK, write the headers, do the first sendfile, turn off CORK, then turn TCP_NODELAY on. Seems like we should be able to get rid of the TCP_NODELAY syscalls in many cases if we used a lazier approach and kept track of the state. The stat()-open() sequence is more expensive than open()-fstat() because the kernel has to do two path lookups, each time holding a spinlock on an SMP. But how could we switch to fstat portably? Teach apr to do open()-fstat() on an apr_stat call, and hide the results of the open until you call apr_open? The times() call - that's probably my fault due to having ExtendedStatus on. Greg
