1) mosh lowers the average latency, but it causes the perceived latency to be highly variable.
The issue is that there are various moments where the algorithm somewhat-correctly decides it cannot predict what will happen due to new incoming keystrokes. An example of this is after you hit enter: you might be running an entirely different program at this point.
In essence, the algorithm "warms up" as it makes correct decisions, and once it decides "ok, my decisions seem accurate: when he types a character they seem to echo back to the terminal" it makes a sudden transition from "slightly slower than raw SSH" to "much faster than SSH and only slightly slower than a local screen session".
These sudden transitions are jarring: when they happen to you with normal connections the expectation is "oh, my connection is failing", a feeling that with mosh you have every time you type a command.
Meanwhile, for the interactive-shell or complex-text-editor use case, these "unpredictable events" always happen at the worst possible moment: when you first start doing something; the result is that the perceived incidence of latency is actually worse than with normal SSH, as every "new event" has a higher latency... by the time it starts prediction, you are probably "in the flow" enough to not even be paying attention.
2) it relies on a specific range of UDP ports
Because it operates over a custom supposedly-mobile-optimized protocol, it tends to end up being inaccessible when you actually need it due to pervasive modern firewalls. You'll start a session at home, go to the office, and... nothing... because you can't communicate over that UDP port. This happened to me quite often while evaluating mosh.
3) it doesn't have a good way to reconnect later
While it supports sitting down at a different computer and taking over your session, it requires you to drop to a rather low-level mechanism based on knowing the secret session key that was established at the time the server was setup. This actually undermines the "mobile" use case, as it only lets the connection be mobile, not the session.
(I also have some specific issues with a library it relies on for spoofing hostnames in wtmp: just having that library installed on your system opens a vulnerability where any non-privileged user can spoof their hostname as anyone else... their opinion differs, but it seems to mostly be due to a knee-jerk reaction of "you don't get fired for avoiding setuid" than "this is actually secure".)
The result is that after spending a bunch of time testing it, working with the codebase, getting frustrated at a bunch of the design decisions, and then having it both totally fail to work in real-world network settings and become yet another source of infuriating latency, I pretty much dropped all interest in the project and replaced it with autossh, which worked great.
function cysh() {
AUTOSSH_GATETIME=0 autossh -M 0 -t -e none \
-o ServerAliveInterval=2 -o ServerAliveCountMax=4 \
"$1" screen -xRS "$2"
}
The primary downside of this is that it doesn't handle the packet loss problem well, as you are really just still using normal SSH to do the connections. The session might get weirdly slow and even lock up in these packet-loss situations.However: it doesn't require any special code on the server, which is a downside of mosh I didn't even list above (as it is fairly obvious and something you know going in): this means you get to use it for every connection to every server you might ever care about.
Otherwise, you get everything you expect from normal ssh and screen: it works everywhere you might theoretically have been able to connect to the server anyway (so no ending up at the client site and finding out that they firewall UDP), it is obvious how to reconnect to (or even share) the screen session from a different computer or a different client without special software, and you don't need to even contemplate "what if this introduces a security vulnerability by running a new daemon on my server?".
The other annoyance of using autossh is it is pretty adamant about doing exponential back-off on reconnect, and in the naive way I have it setup in that function it is also going to be doing slow-to-fail DNS requests as it attempts to do the reconnection sequence, so the result is that the "open laptop, wait for all terminals to connect" sequence doesn't always click perfectly.
However, that is easily fixable by using a simpler wrapper (to be clear: use autossh when autossh is appropriate; it is designed, however, for server-to-server backend links to maintain persistent port forwarding), so I bring you cysh.sh, which is what I actually use (and which I've done some testing with others to verify works on random platforms):
http://test.saurik.com/hackernews/cysh.sh
(Yes: you are now downloading a random shell script from someone on a web forum. However, it's like 35 lines of very easily readable sh: you should just read it; hell, after reading it, you might consider it so simple you just want to rewrite it for yourself. ;P)
You use this in the same way as the function, which I didn't even document earlier anyway as I knew I'd just be replacing it with this shell script by the end of the comment ;P.
cysh saurik@server.saurik.com stuff
This will reconnect to the existing session named stuff on server.saurik.com with the username saurik. It will disconnect other clients when it connects: if you don't want that, change -dRS to -xRS. It also disables normal screen control with ctrl-A (so it feels more like "just a console"): if you don't want that, remove -e'\0\0'. If you want some other screen setting: just add it. ;P(BTW, if you are curious why I have it set to do -dRS "by default" as opposed to -xRS, is that if you have multiple clients associated with the session the size of window can't be automatically updated; the result is that you often find yourself connecting back to copies of things like irssi or even bash prompts that are now the wrong width; -dRS works perfectly out of the box. Many people, however, know enough about screen that they love -x: if that includes you, you should definitely just change that.)
So, if you don't need the "severe packet loss" protection, I really think you are better off just passing on mosh and using something infinitely simpler cobbled over ssh. The latency mitigation feature are overrated or even annoying, and it seems many people actually just want mosh for "easily auto-reconnecting mobile shell", something you seriously can solve very well with a very short shell script and no special server-side logic.
(If anyone tries using that script, it doesn't work, and you want help debugging it, I'm happy to do so; that said, it is purposely not "a product" right now because different people seem to want different things, and it is frankly really simple to write this from scratch if you need it, or just kind of pull it apart and fix/change whatever you don't like about it: just attempting to get an automatically-reconnecting shell is a fairly simple problem.)