On 18/07/2006, at 2:39 AM, Kevin Windham wrote:
On Jul 17, 2006, at 10:48 AM, Stefan wrote:
Am 17.07.2006 um 14:11 schrieb Jeff Ayling:
Hi All,
I'll start off with the situation ....
I have built an RB web server which is required to serve around
100 small images via a single html page (the html page and all
images are being served via the RB web server). Although the
images are loading in the browser they seem to load one at a time
even though Safari and most browsers are able to request and
display a number ( often 4 or 8) of images at once. It seems that
my RB web server is not able to receive and respond to more than
one request at a time.
You need to handle keep-Alive sessions. If you don't handle this
correctly,
your server or the clients opens and closes a TCP connection for
each image.
While the browser might try to handle many sessions in parallel,
your RB app
is likely to establish new connections not as fast as possible.
I think Stefan has probably surmised correctly. In the HTTP 1.1
protocol keep-alive is the norm. If your server responds as a 1.1
server then the client will assume it can pipeline multiple
requests into the existing socket connection. Your server will need
to handle this pipelining properly to get the best speed. You can
look at the http rfc for more info, or just capture some packets
from the same page being requested from apache, and that should
help you get an idea of how it works.
HTH,
Kevin
Hey Stefan and Kevin,
You guys hit it on the head alright.
I'm now sending the following in my headers and I have removed my
code to close the connection:
"Keep-Alive: timeout=2, max=199"
"Connection: Keep-Alive"
I'm now seeing a dramatic increase in performance loading multiple
image files at least 400% faster.
Thanks very much.
For my initial tests I have simply commented out my me.Close in the
Sockets SendComplete event - what would be the best way to close
these sockets now that I'm using the Keep-Alive?
Again - thanks so much for your advice.
Cheers
Jeff
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>