2 months ago
Hello,
I have a project I am hosting that runs a python script and OpenAI API and communicates with the API. The token input is large, with multiple iterations, and can take over 5 minutes for response. I have tried adding keepalive requests every 20 seconds as well.
Now, I'm not sure if this is the issue anymore. The backend deployment logs are fine. The script runs fine locally. But always a bit over the 10 minute mark, the run on my deployment is erroring out.
From the UI (Attached)
From browser console logs:
dummymining2-production.up.railway.app/api/bobbys-script/stream?iterations=12:1 GET https://dummymining2-production.up.railway.app/api/bobbys-script/stream?iterations=12 net::ERRHTTP2PROTOCOL_ERROR 200 (OK)
6 Replies
2 months ago
On our end, the timeout is 15 minutes, if you are running into anything lower than that, it would be a timeout at the application layer.
I see, even with keepalive sending it will close after 15 minutes right?
If I switch to websocket, it might fix the stream timeout, do you know if it would still kill the python job when the connection drops too?
And if yes to that, would the only solution be to decouple the job execution from the connection ?
2 months ago
Which http client are you using? Can you try increasing the timeout in the http client you are using?
One more option (but it shouldn't really matter) you can try deploying your service in a different region to see if it change, this shouldn't be the final solution but just a way to get more information