Low Latency Networking Suggestions (s/w and h/w)
I'm wondering about various techniques/tips/tricks/silver bullets fellow SO'ers utilize when investigating network latency issues and the various solutions and optimizations that are Incorporated.
开发者_开发百科I'm looking for solutions that can be applied to both software or hardware.
For example:
- Increase socket buffer sizes
- Use OS's best option for reactor pattern (select is not always the best option)
- Use of extreme end NICs such as bigfoot Killer 2100
- Keep network cables as short as possible, do not tie network cables around each other
- When copying large amount of data between 2 points - take into account round trip latencies and use multiple socket connections to fully saturate link
What are some others suggestions?
Here are a couple things that have helped me speed things up or increase bandwidth over the last 10 years or so...
1) Turn off the Nagle algorithm when your nodes are physically close together on a fast link and the data in the packet is not smaller than the TCP packet overhead. MS did a paper about this. A counter example to this is when you have a satellite connection in your link and a packet takes 800 milliseconds one way due to the distances involved. In that case, Nagle is a good thing.
2) Make sure you have the MTU size set correctly for your link and your machine to avoid fragmentation issues.
3) If you're on Windows and outgoing packets are small and the latency is high, you should also set the socket option SO_SNDBUF to 0 to avoid transmission delays.
It's not always possible but if you can insert locally caching servers nearer to the destination that can help.
精彩评论