Skip to content

TaskConfig: Add option for file_limit to set RLIMIT_NOFILE#180

Open
sundbry wants to merge 1 commit into
Roblox:masterfrom
arctype-co:file-limit
Open

TaskConfig: Add option for file_limit to set RLIMIT_NOFILE#180
sundbry wants to merge 1 commit into
Roblox:masterfrom
arctype-co:file-limit

Conversation

@sundbry

@sundbry sundbry commented May 11, 2024

Copy link
Copy Markdown

Depending on the workload, the default resource limit (ulimit) for the max number of file descriptors per process may need to be raised, such as for database servers. Add a file_limit option to the task config which will allow the limit to be set per task.

Comment thread containerd/containerd.go Outdated
containerd.WithRuntime(d.config.ContainerdRuntime, nil),
containerd.WithNewSnapshot(containerConfig.ContainerSnapshotName, containerConfig.Image),
containerd.WithNewSpec(opts...),
withFileLimit(uint64(config.FileLimit)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of unmarshalling just-built spec back, I'd suggest setting rlimit by appending your function to opts

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for pointing that out, I had to read a load of source code to find the right knobs to twist for this and that was something I missed. New revision just pushed up and verified in my test system!

@sundbry sundbry force-pushed the file-limit branch 2 times, most recently from eea3c06 to eb2daff Compare May 11, 2024 09:08
@sundbry sundbry requested a review from slonopotamus May 11, 2024 09:23
Depending on the workload, the default resource limit (ulimit) for the
max number of file descriptors per process may need to be raised, such
as for database servers. Add a `file_limit` option to the task config
which will allow the limit to be set per task.

Signed-off-by: Ryan Sundberg <ryan@arctype.co>
@sundbry

sundbry commented Sep 5, 2024

Copy link
Copy Markdown
Author

@slonopotamus Please re-approve when you get a chance, I had to rebase the branch. Thanks!

@github-actions

github-actions Bot commented Sep 5, 2024

Copy link
Copy Markdown

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@sundbry sundbry requested a review from slonopotamus September 5, 2024 19:44
@sundbry

sundbry commented Sep 5, 2024

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@olljanat

Copy link
Copy Markdown

FYI, this is included unofficial v0.9.5-beta1 in case someone is interested.

@sundbry

sundbry commented Feb 12, 2025

Copy link
Copy Markdown
Author

@olljanat Awesome! I'm thrilled that you've taken this initiative. I will switch over my builds to use the new fork.

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