Socket disconnects after 10 minutes

luis-herasme
PRO

3 years ago

Hi, I have a project with node.js, and I use ws as the socket library. The socket connection closes after 10 minutes, even if messages are sent back and forward between the client and the server. I think the problem is not related to my code because when I run the server locally, I do not get the socket disconnected error, and the error code is 1006.

Is there any socket connection duration limit in the default configuration for the free tier?

0 Replies


3 years ago

oof


luis-herasme
PRO

3 years ago

Wow


luis-herasme
PRO

3 years ago

That was fast


luis-herasme
PRO

3 years ago

Thanks


luis-herasme
PRO

3 years ago

N/A


3 years ago

When you proxy requests at Railway scale, keep alive connections have to be killed.


luis-herasme
PRO

3 years ago

So the only way to solve this problem is to add a domain?


3 years ago

yes


3 years ago

Our guess, could be wrong is that if you are hosting a realtime application, it's likely its a serious usecase. Hence, most people who need it would likely be using a domain.


3 years ago

We have a fix on the way, but it will be a long time till we get to it.


luis-herasme
PRO

3 years ago

Ok, thanks a lot


luis-herasme
PRO

3 years ago

The problem persists after adding a domain


3 years ago

Yes, so the other thing you need to do is -> send some keepalive traffic on your websocket every 10-30 secs (socketio does this with websocket pings by default) so that you don't hit any TCP idle timeouts.


3 years ago

You are likely hitting timeouts


luis-herasme
PRO

3 years ago

Thanks, but I'm already doing it


luis-herasme
PRO

3 years ago

And it happens exactly after 10 minutes


3 years ago

Not great then, will talk to our engineer on that once they are awake.


3 years ago

What are you trying to host on here?


3 years ago

Personal project? Very commerical mission critical workload?


3 years ago

This will help me determine the priority.


luis-herasme
PRO

3 years ago

A game


3 years ago

gtocha


luis-herasme
PRO

3 years ago

It is in development


3 years ago

cool: project id?


luis-herasme
PRO

3 years ago

576c94c0-d93a-420e-a522-38cd07a04f0f


luis-herasme
PRO

3 years ago

The problem is solved now I did not update the URL of the socket


luis-herasme
PRO

3 years ago

Thanks for your time


mrcatnip
HOBBY

a month ago

this thread is gone, damn


a month ago

@antoniobelluci if your websockets are disconnecting see this thread https://discord.com/channels/713503345364697088/1385626689802997906

team is aware