Skip to content
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

Create CPU Quota framework #1456

Open
prioux opened this issue Jan 7, 2025 · 2 comments
Open

Create CPU Quota framework #1456

prioux opened this issue Jan 7, 2025 · 2 comments
Labels
Admin Features or bugs related to administrative features Enhancement Priority: Normal User Interface

Comments

@prioux
Copy link
Member

prioux commented Jan 7, 2025

We have already a nice disk quota framework implemented as ActiveRecords. The system works through callbacks during the userfiles save() method, and can limit a specific user (or all users) to a maximum amount of bytes or files on a DataProvider.

I think we should create a parallel, very similar framework for limiting the amount of CPU a user request. When the quota is exceeded on a Bourreau, the user would be prevented from creating new CbrainTasks on it.

The check would be performed by a sum() of the values of the records in the ResourceUsage table, which are all persistent even when users delete their tasks.

We have two approaches for this feature:

  1. a distinct table (DiskQuotas use the table 'disk_quotas' and CpuQuotas would use 'cpu_quotas')
  • this would imply recreating a full new interface to query and set the quotas
  1. we rename 'disk_quotas' to 'quotas' and add a 'type' attribute, turning the table into a multiple inheritance table
  • this would allow use to use the current interface and adjust it to support the two types of quotas
  • we'd need to add columns "remote_resource_id" and "max_cpu"
  • the type of quota determines which attributes are meaningful
@prioux prioux added Admin Features or bugs related to administrative features Enhancement Priority: Normal User Interface labels Jan 7, 2025
@prioux
Copy link
Member Author

prioux commented Jan 23, 2025

Unlike for disk quota, we also need a time range. Weekly quota? Monthly? Total max limit too? These would all require separate attributes.

@MontrealSergiy
Copy link
Contributor

I would mimic the Slurm or mobile operators - the more you use, the slower you speed e.g. adding artificial delays after reaching the quota, proportional to overuse and/or number of scheduled and running tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Features or bugs related to administrative features Enhancement Priority: Normal User Interface
Projects
None yet
Development

No branches or pull requests

2 participants