0

I have a DigitalOcean droplet on which I have deployed a Docker container (Docker version: 20.10.14), but my app is sometimes slow, therefore I would like to allocate more resources to it.

The droplet has 16 CPUs. When I run docker stats, I can see that my container's CPU usage averages 120-140%.

When I monitor my droplet's CPU usage, I can see it's at 8%, which is coherent with my container's CPU usage: 130% /(16 * 100%) is roughly 8%.

enter image description here

I have used docker update to make sure that --cpus is at 16 and --cpuset-cpus is at "0-15" for my container, but what else could I do to make sure that my container makes full use of the droplet's resources?

Thank you!

asked Apr 5, 2023 at 21:04
1
  • 2
    Is your app able to use more than one core? Commented Apr 5, 2023 at 22:58

1 Answer 1

7

Usually docker container resources are not limited by default. You have to explicitly ask for stricter limits. Without more information, my guess would be that the problem is in your app, not in docker. It can be tricky to make an app CPU bound. Your IO needs to be fast enough. You need adequate buffering. You need tuning of concurrency and threading. Throwing more resources at a problem can only take you so far.

answered Apr 5, 2023 at 21:28
1
  • Keeping 16 cores at 3 GHz fed with 64 bits of new data every clock cycle is on the order of terabits per second. Sure, you're not processing completely new data every cycle, and not all your cores are running at 3 GHz, but that gives you an idea of how much I/O you need. Commented Apr 6, 2023 at 7:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.