Hello,
On 2 May 2001, Andreas J. Koenig wrote:
> Let's rewrite the above formula:
>
> MaxClients / KeepAliveTimeout
This is more correct but it is too pesimistic, though :)
> denotes the number of requests that can be satisfied if all clients
> *send* a keepalive header (I think that's "Connection: keepalive") but
> *do not actually use* the kept-alive line. If they actually use the
> kept-alive line, you can serve more, of course.
The browsers are not such evils :) They close the connection
after use.
> This may have a variety of reasons. Try this: start apache with the -X
> flag, so it will not fork children and set the keepalivetimeout to 60.
> Then load a page from it with Netscape that contains many images. You
> will notice that many pictures arive quickly and a few pictures arive
> after a long, long, long, looooong time.
Yes, same as when the browser uses one connection.
>
> > KeepAlive Off can be useful for banner serving but a short
> > KeepAlive period has its advantages in some cases with long rtt where
> > the connection setups costs time and because the modern browsers are
> > limited to the number of connections they open. Of course, the default
> > period can be reduced but its value depends on the served content,
> > whether the client is expected to open many connections for short
> > period or just one.
>
> When the browser parses the incoming HTML stream and sees the first
> IMG tag it will fire off the first IMG request. It will do likewise
> for the next IMG tag. At some point it will reach an IMG tag and be
> able to re-use an open keepalive connection. This is good and does
> save time. But if a whole second has passed after a keepalive request
> it becomes very unlikely that this connection will be re-used ever, so
> 15 seconds is braindead. One or two seconds is OK.
May be 5, it depends on how fast are the clients to send the
next request over the same connection. You can see longer times for
TCP connections with large windows or, for example, when the server
sends the data but the kernel still transmits the datagrams. At HTTP
protocol level the server can't receive ack when all data is received
in the client socket, so you have to add more seconds to the KeepAlive
interval to account this delay for the transfer. It also depends on the
object size, on the used socket write space in the kernel and may be
on other things. So, for clients downloading 16K image with 2K/sec
you will need 8 seconds keep alive timeout because this time period
may be starts after succeding write(client_fd, buf, 16384)=16384
operation in the server, not sure.
> In the above experiment my Netscape loaded 14 images immediately after
> the HTML page was loaded, but it took about a minute for each of the
> remaining 4 images which happened to be the first in the HTML stream.
This is understandable.
Regards
--
Julian Anastasov <ja@xxxxxx>
|