-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isolate is significantly slower with CG enabled #126
Comments
I am using Isolate with CG on Ubuntu 22.04 and do not observe such slowdown. I disabled cgroups v2, though, using GRUB's Note -- I am just an Isolate user, not maintainer. I honestly do not know how cgroups v1 vs v2 affects the correctness of execution sandboxing, at least for my project (online judge for competitive programming). |
Yep, i tried isolate is two modes:
Both of them add +15-25 ms to init sandbox or run a command with |
Can you use BTW do you have an application where this makes a difference? |
Here it is: isolate-init.txt, isolate-run.txt. This is the version from As I see, during An application where this really makes a difference is high-load online judge – when you have many small tests, on each of which the solutions usually work for 1-2 ms, increasing the judging time by 10-20 times is a bottleneck :( |
It seems that this slowdown is not caused by the isolate itself, but by the implementation of cgroups v1/v2. One idea to improve the situation is to add a soft cleanup that doesn't remove the entire sandbox, but resets it to its original state without re-creating the control group. This will at least eliminate the @fushar, you said that you do not experience such slowdowns, but it seems that such delays are present on every Linux. Maybe the 30-40ms difference is just not noticeable in your case? Could you please measure it? |
I will try profiling it using a system-wide profiler, but at the moment, stabilizing and merging support for cgroup2 has higher priority. |
Surely! For the future: as profiled by @purplesyringa with
|
Hello! I wanted to chime in and suggest that maybe the Despite not having an official glibc wrapper function, the |
Update: according to the manpages, CLONE_INTO_CGROUP and using the clone3 syscall would fix this issue:
|
Thanks for the idea, but I'm going to postpone it for a while, because I was sitting on the cgroup v2 version for too long and I would like to release it soon. Also, |
On fresh Ubuntu 22.04 installation, working with isolate in cgroups mode is incomparably slower than without it. This work both for
master
andcg2
branches.Same for run:
Is there any workaround to fix it, maybe changes to isolate's code or OS tweaking?
The text was updated successfully, but these errors were encountered: