App stop responding after sometime. Works on app restart for a while.

I have an app hosting a website. It works as expected, but after sometime (10 mins, 30 mins, 1 hour), it stops working. When I try to access it via a the fly.dev or my custom domain it is unresponsive and after a while I see on monitoring: mia [error] could not make HTTP request to instance: connection error: timed out

If were to restart it using fly apps restart ... it starts working again, then it stops again.

What could it be?

I see the mia [info] GET /healthcheck 200 on the logs

When I do fly scale show -a [app_name]:
app 1 performance 2 4096 MB mia

I set it up to be: performance-2x, although in the fly.io dashboard I see it says shared-1x-cpu@256MB on the app overview or the machine overview (don’t know why).

More info: It has 10GB volume attached, and I have a connection to redis using upstash

Let me know if you can help me out.

Bumping up this conversation. Can someone from the fly.io team help me out here?

Hi @armando

Does your app stop working while users are accessing it, or when idle?

You could try posting more logs here, as well as your fly.toml file (redacted if needed), and maybe what framework you’re using. Someone might be able to help with this extra info.

Hello! Thanks for the reply @andie . App stops working when iddle

No relevant logs, just this one, after a while trying accessing the website (timeout)

mia [error] could not make HTTP request to instance: connection error: timed out

And the 200 from the healthcheck:

 mia [info] GET /healthcheck 200 - - 6.636 ms

On the other hand: fly.toml

app = "my-website"
primary_region = "mia"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[experimental]
  allowed_public_ports = []
  auto_rollback = true
  cmd = "start.sh"
  entrypoint = "sh"

[[mounts]]
source="sessions"
destination="/sessions"

[[services]]
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.http_checks]]
    grace_period = "5s"
    interval = 10000
    method = "get"
    path = "/healthcheck"
    protocol = "http"
    timeout = 2000
    tls_skip_verify = false

    [services.http_checks.headers]

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

App is remix.run app

I’ve been reading that people have had issues apparently with redis connections. I’ve playing around with client settings but no luck so far. Waiting on results on my last tweak that have to do with the pingInterval in the client.

Any thoughts?

Added pingInterval: 5000 to my createClient function (when creating redis client). It appears to have solved the issue at least for me.

Thanks

1 Like

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