Nagle's algorithm

edited January 2011 in Photon Server
Hello, few days ago friend (playing WoW) told me about certain popular "tweak" to reduce his ping and asked me what exactly this tweak does, although I don't play WoW i found that interesting. After some research i found out that it effectively disables Nagle's Algorithm in registry for entire Windows. WoW appears to use client-based ping as kind of a reporting to server. However that packet apparently sits in a nagle's buffer for a while thus latency game is showing is considerably higher than it should be. I think that game won't get any faster and its very stupid thing to do as disabling NA is surely resulting in unnecessary and considerably higher packet flow from everything running on that system.

My question is, if such user was to run my client and connect to Photon server, will it lead to higher load than usual? What steps should be taken, detect disabled NA and force user to enable, use own implementation inside client code, or I am completely off and Photon networking is not using NA whatsoever? 8-).

EDIT: found NA can be enabled/disabled in photon config, is it only for server or also for client? Sorry i lack in this area a bit :).


  • Nagle's Algorithm url=]Wikipedia[/url tries to optimize the packet flow for TCP. This algorithm has two sides: it can minimize the overhead and make sure the flow of packets more smooth and in worst case, it reduces the flow of packets too much (for gaming) and takes long to recover from lost packets. If a game uses TCP sockets, it usually can also turn Nagle or or off. If Wow uses this, it probably makes sense.

    In Photon, we use our own protcol and send packages via UDP. As the protocol is established and from your perspective works like TCP with more features, there is no reason to use TCP at all ;)