Currently YANET uses a unix socket to exchange counter values between cli, ControlPlane and DataPlane. The method involves a query that is answered with a sequence of corresponding values, which results in relatively high consumption of CPU cycles and memory and appears excessive if only a few values are required.
Since we have had success passing data through shared memory as a dump, I would like to suggest considering the following counter monitoring scheme:
Allocate a piece of shared memory large enough to accommodate all possible counters.
Each counter in this memory fragment is identified by its offset.
There is a mapping between the measured value (firewall rule activation counter, incoming/outgoing packets and transmissions, etc.) and the counter ID.
The manufacturer increments the corresponding value as required (firewall rule activation, route selection, etc.) using its offset.
Each thread has its own piece of shared memory to deal with cache conflicts and synchronization problems.
The consumer connects to the desired piece of shared memory and reads whatever it wants without any impact on the producer.
Currently YANET uses a unix socket to exchange counter values between cli, ControlPlane and DataPlane. The method involves a query that is answered with a sequence of corresponding values, which results in relatively high consumption of CPU cycles and memory and appears excessive if only a few values are required.
Since we have had success passing data through shared memory as a dump, I would like to suggest considering the following counter monitoring scheme: