[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: kio_http, persistent connections
From:       Dirk Mueller <mueller () kde ! org>
Date:       2001-06-04 17:55:25
[Download RAW message or body]

On Mon, 04 Jun 2001, Rik Hemsley wrote:

> When requesting a web page which includes quite a few (about 10) small
> images, it appears that kio_http creates about 4 connections to the
> server. This, I would guess, is to allow 'parallel' retrieval of the
> various components that make up the page.

Yes. the image retrieval algorithm is currently using 4 connections in 
parallel (head of khtml/misc/loader.cpp).

> This is fine, if kio_http will send "Connection: close" in a future
> request on the same connection. Unfortunately, it doesn't. Instead, it
> seems try to open another connection to the server instead.

euhm. you mean when there is a connection: keep-alive you're only allowed to 
open one connection to the server ?

> According to RFC2616, clients should simply pipeline requests without
> waiting for a response from the server.

so it should keep sending request headers without waiting for the first 
request to be finished ?

that would explain why KIO is still a few magnitudes slower in retrieving 
webpages than i.e. IE/Netscape. 

> If kio_http were to limit itself to 4 connections and, when it has
> reached this limit, send further requests (pipelined) on the existing
> 4 connections, with "Connection: close" as a header in the final
> request, there would be no problem.

Well, it can't do a connection:close because it never really knows when 
there is no further request. I guess we have to do that via a timeout. I 
don't understand why it has to be done via a Connection: close instead of 
simply closing the socket. 

> With the current implementation of kio_http, I need to set quite a
> high simultaneous connection limit in the server, to handle the case
> when kio_http fires off what appears to be an unlimited number of
> connections.

unlimited number ? huh?? that is a bug then. 

> will be requested. Even with this knowledge, a perfect implementation
> would be difficult, as the user may quickly select a link on the
> page, so some requests are cancelled and new ones are added.

Well, it seems that you understand the issue. Make suggestions on how 
khtml/kio_http should improve. 

> I think that the best solution would simply be to ensure that no
> more than 4 connections are made to one host.

why ?


> I would still need a large simultaneous limit in my server, because
> kio_http does not close the connections when finished - it just leaves
> them to timeout.

but then the slaves will be reused on a further request (click on a link). 
what do you mean by timeout ? the kio timeout or the server timeout ?

> Perhaps I will have to decide that persistent connections are a bad
> idea, due to the way that kio_http makes connections (and fails to
> disconnect when it should.)

Huh? Why that ? 

I still fail to understand the problem. 


Dirk

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic