Skip to content

Get memory limit by walking up the cgroup tree.#1872

Open
mgoulish wants to merge 2 commits into
skupperproject:mainfrom
mgoulish:memory_ceiling
Open

Get memory limit by walking up the cgroup tree.#1872
mgoulish wants to merge 2 commits into
skupperproject:mainfrom
mgoulish:memory_ceiling

Conversation

@mgoulish

Copy link
Copy Markdown

This change gets the router memory limit by starting at the cgroup node that represents the router process, and then walking up the tree, parent to parent, to find the most restrictive memory limit.

When I ran the router this way:

     systemd-run --scope --user -p MemoryMax=1G  skrouterd -c ./A.conf

It correctly produced this log output:

    2026-06-10 01:02:27.453308 -0400 TCP_ADAPTOR (info) Router buffer memory ceiling: 1.00 GiB (263689 buffers)

And then it correctly ran my test of 20,000 TCP connections across a 2-router network, and both routers stayed below (just barely below) 1.0 GB.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread src/platform.c
FILE *f;

// cgroup v2
snprintf(path, sizeof(path), "%s/memory.max", dir);
Comment thread src/platform.c
FILE *f;

// cgroup v2
snprintf(path, sizeof(path), "%s/memory.max", dir);

@ted-ross ted-ross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please raise an issue for this bug. Also, please remove the changes to tcp_adaptor.c and server.c, which are just added empty lines.

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.

3 participants