Emergency Assistance Request

My application is a websocket application and I can receive hundreds of connections at the same time.
The plan I chose is performance-4x 32GB ram.

I’m getting an error like this:
Instance XXXXXXXXX reached hard limit of 25 concurrent connections. This usually indicates your app is not closing connections properly or is not closing them fast enough for the traffic levels it is handling. Scaling resources, number of instances or increasing your hard limit might help.

What should i do ?
I have inserted some lines into the toml like:
[services.concurrency]
type = “connections”
hard_limit = 1000
soft_limit = 500

What does it mean ? May increase them whatever i want ? Please somebody help me.

I don’t want to get this error even if thousands of people connect.

Edit:
I increased the HTTP request limit, but it is currently timed out while connecting to your instance. this indicates a problem with your app (hint: look at your logs and metrics) I get such an error.

Quick question: did you run fly deploy after changing the settings?

Yes.

I’ve checked our DBs and your hard_limit and soft_limit are properly updated.

Timeouts might indicate the app is slow to respond to our proxy. Can you verify your logs/traces to check if there’s anything weird?

Hint: our proxy does not send 500 errors but could send 502 error. That might help distinguish between app error and proxy error.

Im getting an error like:
“timed out while connecting to your instance. this indicates a problem with your app (hint: look at your logs and metrics)”

When client requests / connections increased. I want to learn what is the problem ?

When the Fly proxy sends requests to your app, it will wait 60 seconds for a response. After that, you’ll see this error. Your app could be timing out for a number of reasons, such as slow database requests, or timeouts to other services that your app connects to.

If your application isn’t logging anything about these timeouts, check to make sure the clients for your target services (Postgres, etc) are configure to log when connection errors occur.

I can always see a certain part of the logs, how can I see the whole thing?

Do you mean they’re cropped?

Try using fly logs -a APP_name on your terminal

I tried this but I still can’t see all the logs. When the timed out error starts coming, it comes every second. I can’t see what’s causing this error.

In that case you might want to ship your logs or exceptions to a place you can debug them more easier. One example is Sentry:

You could also ship raw logs

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.