Cutoff between frontend and backend

osh212
HOBBYOP

2 months ago

Hi,

I'm hosting an app (chatbot) on the Hobby Plan. The problem I have is on a specific feature of the app, deep research with an orchestrator that : Running 200+ web searches in parallel batches, Analyzing 212 sources with LLM calls Synthesizing with LLM Call (a thinking model), Generating 23 slides with code execution (Optional). All the listed tasks (LLMs, web search, code execution) are done via API call, nothing is done locally.
The issue I have is the backend continues to work (based on logs) and produces the final answer, but the fronted simply cuts off at some (the progress % at which it stops varies, could 72% or 28%). Then, i have the to reload the page for the answer to be displayed (given everything gets stored and fetched from supabase). This works perfectly when i run the dev server locally on my laptop , so is there a proxy or some sort of runtime cutoff from railway that i'm missing ?

I added SSE hearbeat keep-alive on the chat route and :

"

			// Prevent Railway proxy timeout on long-running SSE streams
			headers.set('X-Accel-Buffering', 'no') // Disable nginx buffering
			headers.set('Cache-Control', 'no-cache, no-transform') // Prevent caching/transformation
			headers.set('Connection', 'keep-alive') // Keep connection alive

"

but that didn't help.
What am i missing ? please help

Last run railway logs:

"[research] analyzing: Analyzing sources 121-125 of 167 (75%)...

[research] analyzing: Analyzing sources 126-130 of 167 (78%)..." (and it's still going)

But the ui has already stopped at: "analyzing: Analyzing sources 91-95 of 167 (57%)...

Thought for 897 seconds

I'll conduct comprehensive deep research on the geopolitics of XXX since XXXX came to power. This is a complex topic that requires thorough investigation from multiple angles."

Solved$10 Bounty

2 Replies

Railway
BOT

2 months ago


2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody about 2 months ago


2 months ago

Hey, you included "Thought for 897 seconds" in your thread, which would be roughly 15 minutes. Railway has a max HTTP request duration of 15 minutes and I would assume that this is the reason for why your frontend no longer receives data after this period. More on that can be found in the Railway docs. You can add reconnect/resume mechanisms or switch to a different way of passing data from the backend to the frontend, such as utilizing websockets, to mitigate and solve this issue.


Status changed to Solved uxuz about 2 months ago


Loading...