I didn’t change anything in the code for this app for quite some time but suddenly answering HTTP requests takes forever (20-30 seconds) and they often even fail.
That sounds like something in your app is grinding your server environment to a halt - possibly by piling up lots of requests, possibly by running out of memory. (Launching enormous numbers of background tasks could do that, if you somehow end up in a recursive loop.)
What I would suggest is scattering some print statements through your code, and working out at what point it’s dying. You could also check what’s happening in your background tasks at the time when it dies (your prints here will turn up in the App Logs).
Could it simply be the amount of requests? There were anywhere from 1000-2500 http requests per day. But this was stable before. I didn’t have issues for weeks, even after adding the launching of background tasks.
I’d appreciate if somebody from the team could look into this issue from your side.
Today it seems like other apps of mine are affected also. Same errors as mentioned in my original post and they also happen simply when I open the app (one that is accessed only a few times per week).