Hi Ankush Kulkarni,
By default, the HTTP request timeout for Azure App Service is 230 seconds. This timeout applies only to synchronous HTTP requests and does not affect background services** such as IHostedService
or BackgroundService
, which operate independently of HTTP request lifetimes.
In your case, since the embedding generation runs in a background service, this timeout does not apply.
Monitor application and web server logs:
- Navigate to
App Service=>App Service Logs
. - Enable Application Logging and Web Server Logging.
- Check the logs in Log Stream to find out the root cause of the abrupt restarts.
If a process consumes more than 100 MB private bytes of memory then a memory dump will be created.
This does not directly cause a restart, but it can trigger a memory dump, and it could be part of an auto-heal rule that restarts the app if configured to do so.
- 100 MB is quite low for a .NET app performing embedding generation.
- As your App Service Plan (P1mv3) has 16 GB RAM, you can increase the private bytes threshold.
Try updating Auto-Heal Rule:
- Go to
App Service => Diagnose and Solve Problems => Auto-Heal => Memory limit
. - Edit the rule which monitors private bytes.
- Increase the threshold to at least 1 GB or higher based on your requirement.
- Alternatively, remove the memory-based auto-heal trigger completely if not needed.
Enable Proactive Scaling Monitoring:
- Monitor actual memory and CPU in App Service => Metrics.
- Set up alerts if memory usage stays near the limit to anticipate issues.
Hope it helps!
Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.