I have a Linux system with NGINX web server, PostgreSQL database server, and many users running processes of same web application, each web application has its NGINX configuration file and a PostgreSQL connection.
I want to balance the load among the users (including NGINX user, PostgreSQL user, and web app users) and my approach is to adjust each user/s CPU time quota/quantum (allowance of CPU time) such that the important users get more CPU time, and less important users get less CPU time. To be specific, I want to assign different quantum quotas for each user. I don't know if that is possible. Is it possible?
I also want to allow the Important users to preempt other processes but not their own processes. For example, I want NGINX and PostgreSQL users to be able to preempt the other users processes but not their own processes in order to increase responsiveness of the system.
If I can't manage it at the user level, how else could I manage system resources among users?
My machine is Ubuntu server 24.04 with default installation .
I have looked up
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/Kconfig.preempt
- https://wiki.linuxfoundation.org/realtime/documentation/technical_basics/preemption_models
But I can't find user specific guide or process based guide showing me how to adjust CPU quotas for users or processes .
Please don't recommend that I use "nice" or "increasing priority" for NGINX or PostgreSQL: these don't work to solve this.