serious lag in tmux mode

1,177 views
Skip to first unread message

CSS

unread,
Jun 23, 2014, 12:37:34 PM6/23/14
to iterm2-...@googlegroups.com
I’ve got an odd problem with lag in my tmux sessions after upgrading tmux…

I’m on the latest iTerm2, and the other day I upgraded to a newer version of tmux (from version 1.8) on my jumphost:

media pkg: tmux reinstalled: 1.9.a_1

Since then, local sessions to the box running tmux are fine, but when I then ssh anywhere, I’ve got a lag that’s just long enough to screw up my typing, maybe 500ms or so. Actual RTT times to these hosts range from 15ms to 50ms.

I’m really at a loss where to start troubleshooting this. At first I just assumed my internet had gone flakey, but direct connections to the same hosts from my laptop or the jumphost don’t exhibit the lag, only sessions going through tmux.

Any clues? Is my tmux too new?

Thanks,

Charles

George Nachman

unread,
Jun 24, 2014, 1:23:17 PM6/24/14
to iterm2-...@googlegroups.com
Hm, strange. If you turn on logging in the session where you launched tmux mode (press L) you'll see a log of commands between iTerm2 and tmux. This may help narrow down where the latency is. When you press a key, we send:

send-keys -t %0 <some hex value>

The server responds with something like this (the numbers vary):
%begin 1403630420 19 1
%end 1403630420 19 1

If the keypress generated output, you'll also get something like this:
%output %0 x

Is the send-keys command sent after a delay? If so, that's an iTerm2 bug. Does it take a long time to get the %begin...%end? Then it could be network latency or a problem with tmux. If those come back quickly but the %output takes a while to return, then the program running within tmux is slow.


On Mon, Jun 23, 2014 at 9:37 AM, CSS <c...@morefoo.com> wrote:
I've got an odd problem with lag in my tmux sessions after upgrading tmux...

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

CSS

unread,
Jun 24, 2014, 4:29:17 PM6/24/14
to iterm2-...@googlegroups.com
On Jun 24, 2014, at 1:22 PM, 'George Nachman' via iterm2-discuss <iterm2-...@googlegroups.com> wrote:

Hm, strange.

Strange indeed…

After spending more time with it, I saw that there was some lagginess in Terminal.app as well going through a straight tmux session.  Not as much though.

I upgraded and downgraded tmux, tried linking with libevent and libevent2, no change.  I could see nothing wrong network-wise, even upgraded pfsense to the latest just to rule out some QoS rule getting mangled in there somehow.  Then I started eyeing the cable modem, which had been up for over a month and I rebooted that.  Problem went away (although before and after ping times were the same, no packet loss on large packets, and speedtests showing 75/25, line usage under 1Mb/s).

I am going to try some of the debugging stuff below just for kicks to see if there’s any hint as to why the latency was worse when going through tmux.

Awesome debug info below, btw, that’s one for the archives. :)

Charles
Reply all
Reply to author
Forward
0 new messages