An Azure service that provides a general-purpose, serverless container platform.
Mutithreading in Azure Container Apps & Container CPU Cores
Hello,
I'm getting an application ready for a production release in Azure Container Apps and I'm trying to do some multithreading optimization but I've been a bit confused as to how many CPU cores a single container instance/replica has access to. I've been setting my Azure Container Apps scale core limit per instance between 1-2 cores, then doing some load testing on the API and monitoring top in one or more instance. The odd thing I've found is that top and lscpu seem to list the cores available as 4 most of the time, but sometimes it will list 8 cores available. I can't seem to figure out what determines the count between 4 and 8. Scaling doesn't seem to be the factor, it almost seems random.
Does anyone know how the cores work inside the container itself, and how best to optimize for mutlithreading? My application can use as many cores as it's given, but I'd like to make sure I'm putting a limit on that to get the fastest response time and have consistency across all the replicas, especially since we can scale the app horizontally anyways.
I've thought about trying to set --cpus in the Docker image to see what happens but figured it was worth asking the community before I spend the time and money re-running the load tests.
Thanks