xpra icon
Bug tracker and wiki

Opened 11 days ago

Last modified 7 days ago

#1680 new defect

proxy performance issues

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

Description

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 7 days ago.
debugging tweaks for ping timing

Download all attachments as: .zip

Change History (5)

comment:1 Changed 11 days ago by Antoine Martin

Status: newassigned

comment:2 Changed 9 days 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 8 days 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 7 days 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 7 days ago by Antoine Martin

Attachment: proxy-ping-debug.patch added

debugging tweaks for ping timing

Note: See TracTickets for help on using tickets.