Forum OpenACS Q&A: Slow file uploads using ACS4.2, AOLServer3.3.1+ad13

I am using an HTML form and ad_page_contract to do file uploading; although with relatively small files (less than 1Mbyte) there are no problems, file uploading gets very slow on bigger files even on my internal network (a 2436 KBytes file takes 30 seconds to upload in my 100Mb/sec switch-based LAN!). I have tried different values (16000, 32000, 64000, 128000, 256000) of iobufsize under the ns/parameters of the AOLServer configuration file but it did not have any impact at all.

Any ideas?
Thank you,

Earlier this year (sometime in February) I described a problem I had with file uploads taking excessively long time within an intranet environment, with effective speeds 750-800Kbit/sec on a 100MBit/s ethernet.

This week I spent some time investigating the problem further. My initial suspicion was that IOBuffers are not really allocated and we end-up reading only a few characters at a time. After checking the socket read/write code in AOLServer (using printf statements) my initial hypothesis was overulled (buffer allocation works OK!).

To cut a long story short, I found out that the culprit was the Silly Window Syndrome (SWS, see Stevens, Vol.1) exhibited by the TCP stack in WinNT4 clients when sending bulk data to the web server (the IE and Netscape browsers may also be at fault here).

The work-around was to change the tcp_deferred_ack_interval parameter in Solaris 8; this parameter indicates the delay in milliseconds before sending a deferred ACK (the default for windows is 200ms, for Solaris 8 is 100 ms and for most linux distributions 50ms; I set it to 10ms and the file uploads are 10 times faster!). I believe the new low value of 10ms is OK for LANs (where RTT for TCP packets are less than 10ms) but it may not work for WANs.

I hope that anybody who would like to speed-up file uploads to AOLServer may find this information useful.