What could cause network latency on a fresh Ubuntu Server 10.10 install?

I have recently purchased a machine to run an online game server. I put the machine together and have installed a fresh copy of Ubuntu Server 10.10. I have noticed that the game server produces a massive amount of lag despite being more than capable of running the server application.

I have been trying to track down the problem all day and now believe it might be something to do with the network connection as when I connect to the server using SSH, on the local network, I get a large dollop of lag before the password field appears. Connecting to the old server on the same network displays the prompt instantly.

My hardware is as follows:

Core i5 2500 3.3GHz Socket 1155
Asus P8P67 R3 Socket 1155
4GB DDR3 1333MHz
500GB 3.5" SAT-III Hard Drive

I use Windows primarily and would ordinarily look for updated drivers if this happened there but I don’t really know where to start to solve this problem on Linux.

Any help would be most appreciated.

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

This can be caused by sshd doing DNS lookups, especially when using SSH keys. You can mediate this by putting entries for your server system’s name and your client system’s name in /etc/hosts.

See http://psomas.wordpress.com/2009/10/19/sshd-reverse-dns-lookup/ for a little more depth.

Solution 2

Most of the times, a annoying small delay when initiating a connection, is due to reverse dns not working. Check your server’s primary/secondary dns entries in its /etc/resolv.conf and whether they work as expected. As @Shawn J, Goff suggested you can test or work around this by manually entering the ip -> hostname entries of your boxes to their /etc/hosts files.

If that doesn’t solve the problem, then check the network settings, it is possible to have the wrong gateway or the wrong netmask configured and still be able to use the internet, but not with optimal functionality.

Next step is to check the arp table with arp -n (for maybe duplicate entries). Check arping -I ethX ip.add.re.ss. If you have duplicated an ip of a machine that is mostly idle, then it is possible to have long delays when connecting and rare disconnects when connected.

Have sudo tcpdump -ni ethX running on a terminal during all the testings and watch for dns traffic, icmp messages or arp packets.

Last (and least probable), cabling or nic problems. Look for Link Up/Downs on dmesg or /var/log/kern.log. Create some traffic and watch for retransmits in tcpdump’s output or if error counters are increasing in ifconfig ethX output.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply