Gallery Remote and with it the Upload Applet are unable to saturate a link with a high BDP (bandwidth-delay product) due to using a (default) send buffer size of 8KB for the socket. Thus, not enough data is in flight to use the available bandwidth due to TCP's flow control algorithm reacting to outstanding acks. With the default buffer size, I can only achieve ~50KB/s on a ~180ms latency link (California - Zurich). Setting the send buffer to 64K increases throughput to ~380KB/s. The patch is as easy as adding two lines (second line for receive buffer size as Gallery Remote and the Slideshow Applet can also receive large amounts of data from the server) after line 3000 ( sock.setSoTimeout(con_timeout); ) of HTTPConnection.java in GR 1.5.1-b46:
Obviously, 64K is just an arbitrary choice I made and one would need to discuss which value makes a sensible default and whether it should be configurable (through properties-file for advanced users, maybe). Even for links without high latencies but moderate latencies in the order of tens of milliseconds like cable or DSL liks, a BDP of 8KB (default buffer size) can already become a limiting factor for throughput soon.
Note that web upload of Gallery is not affected by this as the browser typically creates a default socket and modern OSs auto tuning chooses good values for TCP window sizes. This is also how I discovered that my performance issues were not due to the link but only occured when using the Java parts of Gallery.
Log in to post a comment.