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.
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.
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.
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.