Xpra: Ticket #1680: proxy performance issues

Starting a session via the proxy can make it much slower than normal.

The patch attached tries to fix some of the API issues around idle_add / timeout_add / source_remove emulation.

Fri, 10 Nov 2017 16:37:19 GMT - Antoine Martin: status changed

Mon, 13 Nov 2017 08:47:57 GMT - Antoine Martin:

r17413 merges the improved timer emulation code.

The performance is now much better but I am still seeing the occasional spinners so I am keeping this ticket open.

See also #1684

Mon, 13 Nov 2017 15:49:31 GMT - Antoine Martin:

Running with the patch above and the proxy with "-d proxy,protocol", the bug disappears! The pings come straight back within a few milliseconds, whereas with debug turned off:

2017-11-13 22:41:27,939 send ping: time=236514543
2017-11-13 22:41:29,647 check_server_echo(236514543) last=True, server_ok=False (last_ping_echoed_time=236509541)
2017-11-13 22:41:29,648 server is not responding, drawing spinners over the windows
2017-11-13 22:41:29,652 got ping echo time=236514543

The echo can take 2 seconds to arrive. This is what the proxy sees:

[236589.554657] client sent: ['ping', 236589552]
[236594.555135] client sent: ['ping', 236594553]
[236599.555983] client sent: ['ping', 236599554]
[236599.558696] server sent: ['ping_echo', 236589552, 440, 480, 590, 9707]
[236599.561559] server sent: ['ping_echo', 236594553, 440, 480, 590, 6445]
[236603.128119] server sent: ['ping_echo', 236599554, 400, 480, 590, 1941]

Almost like the pipes need flushing: the pings are sent every 5 seconds, but the echo only start coming back after the 3rd ping is sent.

Tue, 14 Nov 2017 10:59:59 GMT - Antoine Martin: owner, status changed

Instrumenting some more (r17424 + r17425 and updated patch) - in the cases where things were going wrong (ping packets delayed):

Interesting to see that for tiny packets (pings are amongst the smallest - most packets are small, only "draw" packets are big), the cost of going through the proxy is less than 2ms in each direction.

The problem turned out to be caused by r16734 - "trivial" fix in r17426: the callbacks for the proxy server had not been updated and the method arguments ended up using default values. (False for "has-more-packets")

@maxmylyn: mostly a FYI: proxy suffered performance issues in 2.2 until this fix. Feel free to just close.

Tue, 14 Nov 2017 11:00:52 GMT - Antoine Martin: attachment set

debugging tweaks for ping timing

Fri, 01 Dec 2017 22:04:24 GMT - J. Max Mena: status changed; resolution set

Noted and Closing.

Sat, 23 Jan 2021 05:30:54 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1680