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.

I ssh on remote host but terminal performance is poor. Symbols I am typing are not shown immediately, but with some delay. Sometimes two symbols are shown at one time after delay.

share|improve this question

closed as off topic by sysadmin1138 Jul 10 '11 at 23:50

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

11 Answers 11

up vote 8 down vote accepted

High latency is another cause of poor ssh performance. I highly recommend using mtr as a better replacement for traceroute. It should be able to give you some idea of where your network problems might occur.

share|improve this answer

I can think of two possible causes:

  1. Packet loss on the connection
  2. High load on the server.
share|improve this answer

Disabling X11 forwarding if you don't need it (ssh -x) and enabling compression (ssh -C) can also speed up your session.

share|improve this answer

I tried to measure network performance by soon discovered that terminal was fine. What has happened?

We have a load balancing between two Internet channels router. Sometimes it routes my ssh traffic through wan1 and sometimes through wan2. I proposed, that there is something wrong with only one channel. So I measured network performance with mtr (great tool!) for two channels separately.

yeah! wan2 has 21 hops with 110 ms and wan1 has 15 with only 21 ms! wan2 latency is the problem.

share|improve this answer

The most obvious cause for this behaviour is link that is either saturated or dropping packets. How many hops do you have from your workstation to the machine you are ssh'ing into? Have you analyzed a traceroute, if applicable?

share|improve this answer

Use Compression and CompressionLevel of 9. That should help a little. You can configure these parameters in /etc/ssh/ssh_config. But if actual network is very poor this tricks wont do much good.

share|improve this answer

As already said by others, it can come from latency, loss on you network, slow server.
Sometime you see 2 characters at one type because modern TCP stack use an algorithm called Naggle.

share|improve this answer
1  
Nagle's algorithm is always disabled on interactive applications like telnet & SSH –  LapTop006 Jul 3 '09 at 8:22
1  
You don't have enough information to say 'always'. We don't know what ssh client/server he is using. We don't know the OS he is running. etc. With some OS a kernel level setting could have impact on TCP_NODELAY set at application level. –  radius Jul 3 '09 at 9:00

It could also be some SSH Brute Force attempt that throttles your connection. Every time my session runs slow I check the logs and in quite a number of cases someone is trying passwords like crazy.

share|improve this answer

If you are using OpenSSH on a long-fat-pipe (high bandwidth + high latency) make sure you're using at least version 4.7 on both sides because it contains fixes to make OpenSSH use a bigger tcp window size.

 * The SSH channel window size has been increased, and both ssh(1)
   sshd(8) now send window updates more aggressively. These improves
   performance on high-BDP (Bandwidth Delay Product) networks.

This can be important if you want to use the connection to its full potential because otherwise a sender may have to wait for acks before it can continue sending.

share|improve this answer

One thing to look at is simply server memory. I was running an Ubuntu VM with 256Mb of memory and SSH was really sluggish. Doubling this to 512Mb solved the problem.

share|improve this answer

Misconfigured DNS can cause this. The server will respond just fine once logged in, and upload and download files fairly fast, but SSH logins will be slow.

share|improve this answer
    
I found I can drop an IP entry in /etc/hosts for a server that has a slow SSH login and usually that speeds up the initial connection. But the real fix is to get the DNS working properly. –  ServerChecker May 6 '10 at 7:55

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