Skip to content

Optimised monitoring

Serguei Kolos requested to merge optimised_monitoring into 4.2.x

This version keeps publication of monitoring statistics in the main thread of the felix-tohost application while moves the main netio event loop to the other thread. The aim is to avoid latency, which happen due to the statistics publication, which takes ~100 microseconds on px-tbed-felix-04 computer when publishing statistics for 5 E-Links. Presumably with a larger number of E-Links this operation would take even longer. As this was done from the main data handling thread, this blocked data processing for the duration of the publication, thus introducing latency to the data flow path.

The new version still calculates the minimal number of buffer pages for all sockets in the netio timer callback as this operation is not thread-safe and cannot be done concurrently with subscribe/unsubscribe operations. This operation alone takes ~500 nanoseconds on pc-tbed-felix-04, which can be neglected. The publication itself happens in the main thread and therefore doesn't affect data handling. It should be possible to avoid using netio timers all together but this would require adding a mutex to netio-next to protect subscribe/unsubscribe operations, as otherwise race condition will be created by the free pages calculation.

Edited by Serguei Kolos

Merge request reports