httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: some buff.c tuning
Date Wed, 06 Aug 1997 08:42:02 GMT

Your suggestion almost guarantees an extra packet.  Mine is a heuristic
that can avoid that extra packet.  Why not just port my heuristic back to

The cost of doing a remote lookup does not always exceed the cost of
sending a suboptimal packet.  Consider the case where the remote site has
reasonable reverse DNS TTLs ... like say a one week timeout.  There's a
good chance they'll be in a local cache.  Your method causes a flush even
though it's really cheap to do the lookup.

Even in the case of pipelining there is the possibility that client
writers with a clue have already queued image requests on the pipe before
they've received the entire html response.  I think this is even mentioned
in one of the W3 papers. 


On Wed, 6 Aug 1997, Roy T. Fielding wrote:

> I think the pause until get_remote_host is done needs to be fixed in
> 1.2.2 as well as 1.3.  However, I don't think it is necessary, or even
> desirable, to test for the next request before doing the flush.  After
> all, the cost of doing a remote lookup exceeds the cost of sending a
> suboptimal packet by a large amount, and this would only occur on the
> first request of a "HostnameLookups on" resource of the connection.
> Even in the case of pipelining, we want to flush the first response
> as soon as possible so that the client can process it while we are
> doing the lookup.  Therefore, I think we should just flush before the
> call to gethostbyaddr, as in http_core.c:
> +       /* If we have a buffer on this connection, flush it so that the
> +        * client doesn't have to wait for data while we hang on DNS.
> +        */
> +       if (conn->client) {
> +           bflush(conn->client);
> +       }
>         iaddr = &(conn->remote_addr.sin_addr);
>         hptr = gethostbyaddr((char *)iaddr, sizeof(struct in_addr), AF_INET);
> ....Roy

View raw message