xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 5 years ago

Closed 4 years ago

Last modified 16 months ago

#1680 closed defect (fixed)

proxy performance issues

Reported by: Antoine Martin Owned by: J. Max Mena
Priority: blocker Milestone: 2.2
Component: network Version: trunk
Keywords: Cc:


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.

Attachments (1)

proxy-ping-debug.patch (3.6 KB) - added by Antoine Martin 5 years ago.
debugging tweaks for ping timing

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by Antoine Martin

Status: newassigned

comment:2 Changed 5 years ago by 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

comment:3 Changed 5 years ago by 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.

comment:4 Changed 5 years ago by Antoine Martin

Owner: changed from Antoine Martin to J. Max Mena
Status: assignednew

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

  • client sends ping at t1=0
  • proxy forwards it at t1+2ms
  • backend server gets it at t1+5s
  • server responds with ping-echo at t2=0
  • proxy forwards it at t2+2ms
  • client gets echo at t2+2ms

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.

Changed 5 years ago by Antoine Martin

Attachment: proxy-ping-debug.patch added

debugging tweaks for ping timing

comment:5 Changed 4 years ago by J. Max Mena

Resolution: fixed
Status: newclosed

Noted and Closing.

comment:6 Changed 16 months ago by migration script

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

Note: See TracTickets for help on using tickets.