I’m writing a multiplayer Flash game, and the server is written in Python and it updates 25 times a second. Every update, if a player is moving, the server sends out TCP messages containing the new positions of that player. Running locally, everything was lovely, but I’ve recently pushed the code to a higher-spec deployment server (with a 100Mbps pipe connection) to test how it plays.
I’m glad I did, because what I am noticing is that these update messages are bunching up during sending and they arrive in six’s. Testing locally, the messages were arriving at 1/25th of a second intervals, and so player movement was very smooth, now it really isn’t.
If you had this same issue, what are the things you would look at, experiment with, in order to find a solution?
You can try disabling Nagle’s algorithm to make sure segments are sent straight away. However, given your requirements, I wonder if UDP isn’t a better match.