Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi @He, Chao Dong
When a website hosted on Azure experiences high memory usage, it can lead to performance issues, including a "502 Bad Gateway" error. This typically occurs because excessive memory consumption may cause the application to crash or become unresponsive, impacting the website's availability. While Azure can automatically scale instances based on CPU usage without restricting access, high memory usage may prevent the application from responding promptly during the scaling process, resulting in temporary unavailability. It is advisable to monitor memory usage carefully and consider implementing auto-healing features
Automatic scaling in Azure App Service
If your app consistently uses a high percentage of memory, consider upgrading to a higher-tier App Service plan with more resources.
Use the "Diagnose and Solve Problems" tool in Azure to analyze memory usage for each instance. This can help identify whether the app itself or the App Service infrastructure is consuming most of the memory.
references:
Troubleshoot HTTP errors of "502 bad gateway" and "503 service unavailable" in Azure App Service
Automatic scaling in Azure App Service
Please accept as "Yes" if the answer provided is useful , so that you can help others in the community looking for remediation for similar issues.