3

There's a huge latency when I try to connect to our server (Ubuntu server 192.168.53.1) through SSH from a client PC (windows 7 + putty: 192.168.53.X) in a LAN. It takes like a minute for the password prompt to show up. There's also a huge latency when I try to connect to the mySQL database running on the same server. This server is also running SAMBA but this is running very smooth.

Here you can find our network diagram: link text

Any help would be appreciated.

yens resmann
  • 133
  • 1
  • 3

3 Answers3

3

edit here /etc/ssh/sshd_config and change or add UseDNS no

After that restart service ssh demon

then tray again if problem is some

Tray to change or add /etc/ssh/ssh_config in the host * section

CheckHostIP no

ntrance
  • 382
  • 2
  • 2
  • Thanks, UseDNS no fixed the SSH problem! But i'm still having latency problems when connecting to the mySQL server or when I use remote desktop (VNC), any idea? – yens resmann Dec 01 '10 at 13:20
2

mysql service should be started with --skip-name-resolve or you can set the option in /etc/mysql/my.cnf. For ssh you should make sure UseDNS is set to "no" in /etc/ssh/sshd_config

user237419
  • 1,653
  • 8
  • 8
  • skip-name-resolve was allready in my.cnf could it be something else? – yens resmann Dec 01 '10 at 13:51
  • any ipv4 address conflicts on that lan segment? – user237419 Dec 01 '10 at 14:29
  • No, but the ip of our server is changed. Before it was 10.0.0.12 because it was on another network. Now it is 192.168.53.1 I've allready changed the bind-addres to this ip in my.cnf but this makes no difference – yens resmann Dec 01 '10 at 14:39
  • any entries in the hosts_allow/deny file on the server that could trigger a resolve process? if negative, i suppose you already checked the icmp response times between hosts and they look ok? arping is also a good tool on lan – user237419 Dec 01 '10 at 14:58
  • hosts_deny and hosts_allow are commented out. I can also ping to the server from any client. – yens resmann Dec 01 '10 at 15:37
  • should you tie the problem to subnet reconfiguration? I mean, was it working fine before? – user237419 Dec 01 '10 at 17:28
  • thinking maybe you have an internal dns used by the services on your network that you should also update – user237419 Dec 01 '10 at 17:31
  • It was indeed working perfectly before, so my thought is that the previous IP is hardcoded somewhere in the server. But I'm not sure where. /etc/resolv.conf returns 2 dns services (one for the first router and one for the second router which is connected to the internet) – yens resmann Dec 02 '10 at 08:41
0

I have been able to reduce latency to my ubuntu server with the following:

# echo 1 > /proc/sys/net/ipv4/tcp_low_latency
# echo 1 > /proc/sys/net/ipv4/tcp_sack
# echo 1 > /proc/sys/net/ipv4/tcp_timestamps
# echo 1 > /proc/sys/net/ipv4/tcp_window_scaling

or like this if you want it to stick across reboots:

# echo 'net.ipv4.tcp_low_latency = 1' >> /etc/sysctl.conf
# echo 'net.ipv4.tcp_window_scaling = 1' >> /etc/sysctl.conf
# echo 'net.ipv4.tcp_timestamps = 1' >> /etc/sysctl.conf
# echo 'net.ipv4.tcp_sack = 1' >> /etc/sysctl.conf

RTT on ping went from average of a couple hundred ms (max was sometimes over 1000 ms) down to 1 to 2 ms.

  • 1
    These are useful options, but it's important to understand what they do, and whether or not they'll help, before messing with them. (In this case as seen in the accepted answer the problem wasn't network stack latency, it was slow DNS lookups.) – voretaq7 Nov 16 '12 at 20:51