On BlueOS, the latency gets too high when the data flow via MAVLink2Rest is high, which is using UDP Server. If we change the MAVLink2Rest to the UDP Server, the problem doesn't happen, proving the problem relies on the mavlink-server's UDP Server implementation.
How to reproduce it (google-chrome):
Enable SITL
Open http://192.168.2.2/vehicle/endpoints
Switch to MAVlinkRouter (as a baseline)
Measure the loading time for http://192.168.2.2/vehicle/setup/overview: ~5.4 seconds
Open http://192.168.2.2/vehicle/endpoints
Switch to MAVLink-server
Measure the loading time for http://192.168.2.2/vehicle/setup/overview: greater than 120 seconds
In a short investigation, the problem seems to be the time contention on the clients RWLock.
On BlueOS, the latency gets too high when the data flow via MAVLink2Rest is high, which is using UDP Server. If we change the MAVLink2Rest to the UDP Server, the problem doesn't happen, proving the problem relies on the mavlink-server's UDP Server implementation.
How to reproduce it (google-chrome):
http://192.168.2.2/vehicle/endpoints
MAVlinkRouter
(as a baseline)http://192.168.2.2/vehicle/setup/overview
: ~5.4 secondshttp://192.168.2.2/vehicle/endpoints
MAVLink-server
http://192.168.2.2/vehicle/setup/overview
: greater than 120 secondsIn a short investigation, the problem seems to be the time contention on the
clients
RWLock.