I am writing a business app in python. It uses Ajax to talk to a browser front-end, exchanging messages containing data in JSON format.
I have 2 machines for testing, one running Windows Server 2003 with IE8, the other running Fedora 14 with Firefox 7.0.1. They are both connected to my 100mb lan.
I can test my app in 4 different ways – Windows server/Windows client, Windows server/Fedora client, Fedora server/Windows client, and Fedora server/Fedora client. They all run reasonably apart from Fedora/Fedora, which is very slow.
Here are the timings for one particular request, which results in the server sending a packet of 2488 bytes to the client. I show three timings – first, the time from the client sending the request to receiving the response; second, the time from the server receiving the request to sending the response; and third, the difference, which is effectively the time it takes for the client to receive the response. I have confirmed that the server receives the request virtually instantly.
Ws->Wc 484ms 62ms 422ms
Ws->Fc 432ms 47ms 385ms
Fs->Wc 1188ms 4ms 1184ms
Fs->Fc 3740ms 5ms 3735ms
I need to understand why it takes Firefox nearly 4 seconds to receive 2488 bytes on the same machine.
I don’t think it is a DNS problem, as I am using numeric ip addresses. I have tried using Firebug, but it just confirms that it takes nearly 4 seconds to receive the response.
Can anyone suggest anything else I should be looking at?
I have found my problem! It was an error in my server code.
I was passing the response in such a way that the server was writing it out in packets of one byte at a time. I have fixed it, and it now flies on all platforms.
Sorry for the noise.