Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using ssh to access a laptop (running that connects to the internet through UMTS. It is painstakingly slow to type any command. However when I use SCP to copy a file from the same laptop to the local machine it shows speeds of around 1.25 Mbps (160 KBps) which seems reasonable.

Why does it take so much time to type a command in the remote terminal while it seems I have plenty of up/download speed (assuming the download is more than the upload)?
The results don't change when I use ssh -C, so compression does not help significantly.

share|improve this question

2 Answers 2

Your broadband connection likely has good throughput, but poor or highly variable latency.

I'm betting if you pinged something like Google you'll see pings in the 250ms or higher range, and you probably see it vary wildly and possibly even drop a ping or two.

Interactive-style applications where applications exchange short messages between each other, and depend on them to arrive as quick as possible, suffer in such an environment. Online games usually are built to deal with late network replies so if you play games over this connection, your latency or ping may have been high but you may not have noticed a problem.

In SSH, since when you press a key, it sends a packet to the server, and then waits until it gets a reply before echoing (like a serial terminal does), so you notice this a lot with SSH.

Non-interactive bulk transfers like file downloads won't be affected. The startup time for such a transfer is higher than normal but once it "gets going" it achieves the full speed of your throughput.

Try mosh.

share|improve this answer

In a scp exchange, each packet contains more data (about 256 characters) than an SSH interactive packet would contain (1 character). Thus the number of packets needed to transfer the same amount of data would be quite different.

Remember each packet must also be ACKd so there is considerably more traffic using SSH than using SCP.

Finally, remember each transaction takes whatever the ping time indicates * 2. So you can see there is a considerable time difference as well. And as you move further and further away geographically, this amount of time becomes VERY noticable.

share|improve this answer

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.