New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Limiting CPU usage on a VPS
I want to keep my usage on a shared environment under fair usage and provider TOS. Can you share your cpulimit, docker, proxmox, etc.. setup here and what is the best way to keep the resource utilization within those limits system/service wide without active monitoring?
For example, I'm planning to run Jellyfin with transcoding enabled and want to ensure it stays under acceptable limits to my provider's terms, e.g. 30% baseline utilization per vCPU, burstable up to 100% for 10 minutes, every 24 hours.


Comments
You may want to ask Greencloud for help.
cgroup
For docker, you can control cpu usage, check this out
https://docs.docker.com/config/containers/resource_constraints/#cpu
so you want to use your vCPU at 30% 24/7 ?
not greencloud related.
within acceptable usage limits. I do have dedicated servers and VDS but was wondering how is done by you on a vps.
Already started using it with proxmox ct but checking if there is any other options.
Why would you ask a provider selling unmanaged VPS how to run semi-basic stuff? It's not theirs job, it's not theirs responsibility, you are not paying for theirs sysadmins time. Please stop with advices like that.
almost every cheap provider oversells a lot, using vCPU at 30% 24/7, you will be abusing other users on the node
get another VDS
What if I don't want a VDS for this when I am using it for a few hours a day that may exceed set limits?
Here is an example from aws documentation for application workload and cpu utilisation

Frankly if you have to ask this question then either your use case is in total violation of their AUP or you're being very paranoid.
Most providers put those limits in their AUP just to cover their butts but rarely enforce them unless your usage is well beyond excessive (which does not seem to be your case). I wouldn't worry about it until your provider contacts you.
I for one don't pay close attention to my CPU usage and haven't gotten any emails from the two providers I bought from, and I do occasionally hit 100% CPU usage too.
Use the "nice" command to lower the priority of CPU-intensive programs.
If they tell me limit in FUP and AUP mean am allow to abuse the resources as long as am under them limit since that wat am paying for.
Maybe just want to learn something new?
Seems like an exaggeration, I don't think most oversell that hard. Providers I've gone with usually have some lenient examples like "no more than half the cores average for more than 6 hours" etc. So if you're with a provider that says you can use 30% vCPU dedicated, what's the issue with doing that?
I don't want to be cynical, so I assume providers who cover their asses in AUPs with non-hard values, usually just want to avoid having customers who blast the ports and CPU 24/7, rather than the providers overselling massively. Of course if you ask the provider whether you can use a percentage as dedicated, that shouldn't be an issue, right?
Docker just uses cgroups for its resource constraints, and you can do the same thing for any process on the system. Just search your favourite search engine for how to limit CPU usage with cgroup or cgroup2 (depending on the version you're using).