huronOS-build-tools icon indicating copy to clipboard operation
huronOS-build-tools copied to clipboard

Limit filesystem grow to a % of the available RAM disk

Open equetzal opened this issue 2 years ago • 0 comments

Problem

During the TCMX 2023 it happend a case in which a team implemented a brute force solution in order to find a pattern in a given sequence. This is a common behavior in competitive programming. This team generated many automated files which overloaded the filesystem, easily creating tons of files and reaching the limit of the RAM disk. Even if OOMD exists, it prevents processes from taking all the RAM, but as the filesystems lives on the kernel-space there was no way for the system to prevent the RAM to be floaded.

Proposed solution

Investigate a way to limit the size at which the filesystem can grow. This should not be a fixed-size because that would left too few space for the system, but we can set the dynamic size to never reach more than e.g. 90% of the RAM total space, or to always keep at least 500MiB free of RAM so that the system is responsive and user is able to delete their files.

equetzal avatar Apr 25 '23 05:04 equetzal