Requests sent from the Angular app to api take long time (a minute or more) or completely timeout after around 20-50 requests on production (on my local dev environment with IIS server this may happen a couple times a day, sometimes doesn't happen at all for several days).
Maybe this can give someone a clue. I thought that the problem is with EF queries since I retrieve an entity with its children entities (picture, comments, likes, other business-related entities). But when I close angular app and open again - requests again work fine for the next 20-50 of them.
I also assume that this may be because of DbContext issue, which I was told about by one developer.
Both on the dev and prod environment. However, on production it occurs sooner. The production server has 1GB RAM and relatively slow CPU ($5 Digital Ocean droplet).
Filtered back-end out I realized that the bottleneck could be in my RxJs extensions in the Angular app. I checked them and it turned out that notifications polling observable is created every time I navigate to a new route. After 20-50 navigation events there are 20-50 polling requests which block everything. Polling mechanism re-write fixed the issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.