By johnweisz
Hey,
We are running a microservice on a shared CPU droplet. This microservice performs occasional, long running, CPU intensive background tasks. The time it takes for a task to finish depends on input, and can take from 10 seconds to an hour (or even more), depending on its complexity.
Because the input data is technically user-provided, I’d like to apply a time duration limit. Say, the task is allowed to run for 30 minutes, and if it’s still not done by then, it’s rejected and marked as non-processable.
However, on a shared CPU, it’s well understood that the available processing power is effectively unknown. Thus, in this case, the very same task can take a different duration to finish.
We want to take this into consideration when deciding on a limit, but for that, a rough estimation of CPU power fluctuation is needed.
Does anyone have any experience as to what to expect here? Say, is there a rough threshold of CPU power that’s always available in practice? For example, can we expect CPU power to be at least 20% of its peak capabilities at all times in practice?
Thanks in advance.
PS: I know simply switching to a dedicated CPU would make this a non-issue, but currently it’s way above our requirements.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
I don’t think that there are any official numbers that could be stated here, but in general, at the moment there are no hard limits for CPU usage on Droplets.
However, DigitalOcean teams monitor for Droplets doing a consistent 100% CPU and might CPU limit Droplets displaying this behavior. Since each droplet shares physical hardware with other Droplets, constant 100% CPU use degrades the service quality for other users on the same node. That way other users would not be impacted as much.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.