ioi / isolate

Sandbox for securely executing untrusted programs
Other
1.05k stars 157 forks source link

Limiting CPU time with cgroups #93

Closed hermanzdosilovic closed 1 year ago

hermanzdosilovic commented 3 years ago

Is the -t X equivalent to the --cg --cg-timing -t X or --cg --no-cg-timing -t X?

hermanzdosilovic commented 3 years ago

@gollux any update on this question? cc @bblackham @seirl

Let me know if my question should be more specific, please. :)

gollux commented 2 years ago

If --cg-timing is enabled, the cgroup time is used for the time limit from -t.

hermanzdosilovic commented 1 year ago

Hey @gollux,

Can you please let me know exactly what -t <X> is equivalent to? I haven't figured it out from your answer.

Thank you very much.

gollux commented 1 year ago

-t <x> sets a limit on execution time. The other options select what is execution time: without --cg, it is always execution time of the process inside the sandbox. With --cg and --cg-timing (which is turned on by default if you ask for --cg), it is the total time spent by all processes in the sandbox. With --cg and --no-cg-timing, it is only the single process (this combination exists for historical reasons only as it makes little sense).