R
Railway•14mo ago
bW9ubwo

Sudden gunicorn errors. App unusable.

I get various timeout and memory errors. The strange thing is that the app was running like this before with another hoster and also the first days on Railway did not cause any problems. To explain, there are two running apps. A website and an app that converts/crops images. A calls B, B fetches the original image from A and returns an Optimized image. This should not take long, but now I have sporadic errors that make the page unusable. I have already tried to increase the timeout and the workers unsuccessfully.
No description
26 Replies
Percy
Percy•14mo ago
Project ID: 39aa0a37-73e0-4c64-86d2-8c772db5657f
bW9ubwo
bW9ubwoOP•14mo ago
39aa0a37-73e0-4c64-86d2-8c772db5657f and 36d5ac8d-ceaa-4b8d-9561-d38745c282b4
Brody
Brody•14mo ago
you're on the pro plan, correct?
bW9ubwo
bW9ubwoOP•14mo ago
yes
Brody
Brody•14mo ago
have you moved your project over to the team?
bW9ubwo
bW9ubwoOP•14mo ago
I have tried it in both environments. At the moment the website is in the Team and the cropper in the Hobby section
Brody
Brody•14mo ago
and what app is having issues?
bW9ubwo
bW9ubwoOP•14mo ago
Both show the same errors. Because everything has worked, think there is some sort of networking errors between the two. And that's results in the timeout on both ends.
Brody
Brody•14mo ago
are you using the private network?
bW9ubwo
bW9ubwoOP•14mo ago
no. public interface
Brody
Brody•14mo ago
are either services using a lot of memory?
bW9ubwo
bW9ubwoOP•14mo ago
I dont think so. The stats are locking ok and i never recognized something in the past.
bW9ubwo
bW9ubwoOP•14mo ago
this works but if you visit https://www.blacktre.es
BLACKTREES
Deine Digitalagentur in Leipzig und Köln/Bonn
Shop, Webapplikation oder Corporate Website. 🚀 BLACKTREES plant, managt und entwickelt dein Digitalprojekt! Remote und in Leipzig oder Köln/Bonn.
bW9ubwo
bW9ubwoOP•14mo ago
it will produce a lot of errors. So maybe concurrency is a problem. but just since yesterday
Brody
Brody•14mo ago
yeah this is seeming like a code / config issue, maybe you wanna move to multiple threaded workers for gunicorn instead?
bW9ubwo
bW9ubwoOP•14mo ago
just adding (--threads n) to the config?
Brody
Brody•14mo ago
sorry I'm not well versed in python development, you would significantly benefit from reading some articles about this topic
bW9ubwo
bW9ubwoOP•14mo ago
No problem, i try it gunicorn --timeout 120 --workers=4 --threads=4 --log-level=debug --bind 0.0.0.0:$PORT application:app It works. Lightning fast 🙂 I know that workers need more memory and process management costs extra. I still find the result strange. Eight workers as before should be more than enough and then also the fact that it just stopped working.
Brody
Brody•14mo ago
before you where using a single sync worker?
bW9ubwo
bW9ubwoOP•14mo ago
startCommand = "pipenv run gunicorn --workers=2 --bind 0.0.0.0:$PORT application:app" That is what I had, and it has worked. After the first errors occurred, I tried increasing timeout and workers.
Brody
Brody•14mo ago
(by default gunicorn binds to exactly what you have specified in the bind flag)
bW9ubwo
bW9ubwoOP•14mo ago
What do you mean? There is no problem with the bind. I mean: The request and the scaling should only need a second, or may be two. So even if the app can't do this with 2 workers in parallel, they should still fit in the timeout window one after the other.
Brody
Brody•14mo ago
you're right, there's no problem with the bind, it's just redundant since that is the default bind address
bW9ubwo
bW9ubwoOP•14mo ago
ok, nice that it is running now. Even if it is a bit frustrating not to be able to understand exactly what the problem was. And thanks for your help!
Brody
Brody•14mo ago
that's python / gunicorn for you
Want results from more Discord servers?
Add your server