Dumb question about threads in containers

Davidoff

Well-Known Member
Nov 19, 2017
66
2
48
I've set up a few containers on my single-node Proxmox install, each intended to run a specific application. On a couple of them, I had initially provisioned 1 core, but noticed that usage would spike to 100%. As a result, I added some additional cores to those containers. However, I noticed that the containers in question would appear to only still use a single core. For example, in one container, I increased it from 1 to 2 cores. Usage would occasionally spike to 50% but never more than that. In another, I increased it from 1 to 4, and usage would spike to 25% but not more than that.

The question I have is whether there might be something I need to do or a setting I need to change either in Proxmox or the container itself to enable usage of the additional cores allocated. Or is this more a function of the application in question, such that if it's not written to take advantage of multiple cores, then there's nothing that can be done. If relevant, I believe both applications in the containers in question are python based.

Any suggestions or thoughts would be most appreciated.
 
Or is this more a function of the application in question, such that if it's not written to take advantage of multiple cores, then there's nothing that can be done.
yes, if the application is single threaded, you cannot do anything so that it runs on multiple cores/thread simultaniously
 
  • Like
Reactions: Davidoff
In some case you can try different CPU types, that may solve the issue. Try to select the closest CPU as the node actually has.

I have Westmere CPU, and I selected Westmere for KVM and AMD64 for LXC, and it has better performance.
 
In some case you can try different CPU types, that may solve the issue. Try to select the closest CPU as the node actually has.

I have Westmere CPU, and I selected Westmere for KVM and AMD64 for LXC, and it has better performance.

Appreciate the suggestion. I think that option is only available for VMs. I don't see it as an option for containers.
 
yes, if the application is single threaded, you cannot do anything so that it runs on multiple cores/thread simultaniously
Just one follow-up question: Would increasing the value of CPU units for the containers in question help in this situation? Given that this value only controls relative proportionate scheduling across all containers, and the underlying host still has plenty of excess capacity, I imagine it would not, but thought it would not hurt to double check.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!