notus-sh / chapecron

chapecron - Look after your cron jobs while you're away
Other
0 stars 0 forks source link

Add support for memory usage monitoring #2

Open gael-ian opened 7 years ago

gael-ian commented 7 years ago

The time plugin allows to collect informations about ressources used by a job but is not enough to control the memory usage in the same way timeout do for time.

A quick search provides some useful information about cgroup.

gael-ian commented 7 years ago

ulimit can be used to set limits on CPU time, virtual memory and some other resources allocated to a process but, if its children will inherit the limitations, accounting will start over for each of them. Hence, it's not a first class candidate for a middleware but offers a simple solution that may accommodate most use cases.

Using cgroups, we can set CPU priority, memory limits, I/O and network priority and more for a process and all its descendants. However, cgroups is a Linux only feature and have been "recently" refactored to an unified and more consistent v2 and it's not clear how this new version is currently supported across Linux distributions.

This issue requires more research.