Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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

share|improve this answer
    
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 1 '10 at 13:20

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

share|improve this answer
    
skip-name-resolve was allready in my.cnf could it be something else? –  yens resmann Dec 1 '10 at 13:51
    
any ipv4 address conflicts on that lan segment? –  sysfault Dec 1 '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 1 '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 –  sysfault Dec 1 '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 1 '10 at 15:37

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.

share|improve this answer
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.