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.
11 Answers
Disabling X11 forwarding if you don't need it (ssh -x) and enabling compression (ssh -C) can also speed up your session.
- 271
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.
- 23,963
I can think of two possible causes:
- Packet loss on the connection
- High load on the server.
- 1,765
I tried to measure the network performance but soon discovered that the terminal was fine.
We have a load balancer between two Internet channel routers. Sometimes it routes my SSH traffic through wan1 and sometimes through wan2. I thought that there is something wrong with only one channel, so I measured network performance with mtr (great tool!) for two channels separately.
wan2 has 21 hops with 110 ms and wan1 has 15 with only 21 ms! wan2 latency is the problem.
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.
- 4,793
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?
- 964
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.
- 4,205
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.
- 1,538
- 2
- 15
- 35
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.
- 168
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.
- 235