Skip to content

Cache IsMe() results for process lifetime to avoid netlink contention#140

Open
jason-ni-0 wants to merge 1 commit into
bstansell:masterfrom
jason-ni-0:isme-netlink-cache
Open

Cache IsMe() results for process lifetime to avoid netlink contention#140
jason-ni-0 wants to merge 1 commit into
bstansell:masterfrom
jason-ni-0:isme-netlink-cache

Conversation

@jason-ni-0

Copy link
Copy Markdown

IsMe() is called once per console in ConsoleAdd during config parse. On a large config across the master and many forked child group processes, the per call getifaddrs()/freeifaddrs() pair thrashes the kernel's global netlink_table_lock -- this produces multi minute stalls under SIGHUP.

We cache the getifaddrs() result and the per hostname IsMe() answer for the lifetime of the process. Caches are populated in the master before fork, so child group processes inherit them warm via copy-on-write and never touch netlink themselves.

The trade-off: if there is a re-IPing of conserver host without a full process restart, it returns stale answers; but this should be acceptable for the deployment that hit this since re-IP already requires ops intervention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant