Hacker News new | past | comments | ask | show | jobs | submit login

I have been investigating this over the past couple of days for a pet project of mine (a local college needs to setup a programming competition - need to resource limit compile jobs).

The way that systemd handles it is three-fold:

One, in the .service file, you can put in resource constraints [1] - which will be honored by a service on startup.

The second way is to create a .slice file which is exactly that - a slice in the cgroup hierarchy and where you can assign some resource limits (where it is bound by the slices above it in hierarchy). All services that are assigned to this slice will SHARE that cgroup resource constraints. For your specific requirement, this is the way to go. Create a user.slice (to affect all user accounts) or a user-<some uid>.slice to affect on an individual basis (still will inherit from user.slice).

The third way is to invoke systemctl set-property (with properties defined in [1]) to affect an already running process.

What I am attempting to use is systemd-run [3] to start transient processes (not background services) with resource constraints. However, I have filed an enhancement request on some missing features here [4] . Feel free to star it up !

[1] http://www.freedesktop.org/software/systemd/man/systemd.reso...

[2] http://www.freedesktop.org/software/systemd/man/systemd.slic...

[3] http://www.freedesktop.org/software/systemd/man/systemd-run....

[4] https://bugs.freedesktop.org/show_bug.cgi?id=73685




There is runguard [1] from the DOMjudge project. It may be able to do what you are looking for.

[1] https://github.com/DOMjudge/domjudge/blob/master/judge/rungu...


well yes, and there is "isolate" from the Moe project. But systemd is teh new shineyyyy.


Have a look at online judges created by various universities for the ACM intercollegiate programming contest (ACM ICPC). Back in the day I used the one from the university of Valladolid, but I can't seem to find the source code now.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: