Hi @浩 笹川
I’m posting this answer to help others in the community who might face the same issue.
The issue is due to container saturation
in azure container app this means your app container used up all the CPU or Memory it was given, and it got overloaded.
ex: just like a small bag trying to carry too many things in it.
This happens because of the app receives too many requests or does too much work, azure has limits like how much CPU/Memory each container can use if the app crosses that limit azure cannot help unless scaling is enabled or resource limits are increased.
To fix:
Increase resource by giving CPU/Memory let say if you have cpu: 0.25 and memory: 0.5Gi change them to cpu: 0.5 memory: 1Gi this gives the app boost up and it prevents saturation if load increases slightly
Let azure automatically add more container instances when load increases example scale rule
scale:
minReplicas: 1
maxReplicas: 5
rules:
- name: httpscale
http:
concurrentRequests: 20
This means azure adds more app instances when more then 20 people hit your app at the same time.
Better you can add alerts like add azure monitor to track when saturation happens set an alert like if cpu >80% for 5 minutes set notification to your mail by giving your mail id, if memory > 90% scale up or investigate.
Key Vault Performance Consideration:
Azure Key Vault is a managed service, so you cannot scale it like a virtual machine. If your application is experiencing performance issues or delays when using Key Vault, it's often because the app is calling it too frequently.
For example, if your app is fetching secrets or keys on every request, this adds extra load and can lead to throttling or slower responses. This repeated access is unnecessary and impacts performance.
To fix:
Instead of calling key Vault every time you need a secret, cache the secret in your app like in memory or securely. for example, store the value for 5 to 10 mints in memory. also, you can use managed identity for authentication instead of secretes it's faster and doesn't hit the same limits.
Note: you can't scale key vault directly but by caching optimizing usage and maybe upgrading to premium you can improve performance, also try removing dapr helps too if it's not essential to your setup.
Doc:
https://learn.microsoft.com/en-us/azure/container-apps/containers
I hope this has been helpful! If above is unclear and/or you are unsure about something add a comment below.
Please click the answer as original posters help the community find answers faster by identifying the correct answer.