mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-12 17:59:06 +02:00
Running several embedded clients in one process is already how the proxy works, and both of the costs below scale with the number of clients. Every engine retains its latest management sync response so that GetLatestSyncResponse can read it back. Retaining it pins a decoded copy of the whole network map for the lifetime of the client, roughly 680 KB per client against a 2000 peer network map. A process holding many clients that never read the response back pays that for nothing, so DisableSyncResponsePersistence lets a caller opt out. Persistence stays on by default. Status runs health probes against every STUN and TURN server and takes the engine lock, which is too expensive to poll at high frequency or across many clients. StatusSnapshot returns the same recorder state without the probes. Reading that state from another module also needs the peer status constants and the per-peer state type, which were only partly exported.