This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: TCP/IP write() buffering question


> The problem is that each JavaScript write() causes a write() on
> the socket, and the web page data is sent as a large number of
> Ethernet packets containing a small number of bytes of data
> each: 50+ packets for a total of about 1500 bytes. This is
> really killing the performance and results in a load time of 2
> seconds for a page that's less than 2K of HTML.
> 
> Is there a way to get the stack to do more buffering of write()
> data so that the page goes out as fewer packets?

Is this a TCP stream of UDP? I know HTTP can use both. For UDP you
cannot do anything. Check if the push bit is set on the TCP
packet. Use tcpdump or something similar. Its possible to set the
socket into a mode where it disables its clumping together of
data. This is useful for interactive connections like Telnet, but not
so good for more bulk transfer such as this. See if the server is
doing a setsockopt with TCP_NODELAY. If so try disabling this call and
see if it makes any difference.

        Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]