Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Feature Requests
  3. Two small manifest fields for slow-starting and long-running apps (AI servers especially)

Two small manifest fields for slow-starting and long-running apps (AI servers especially)

Scheduled Pinned Locked Moved Feature Requests
healthchecktimeout
6 Posts 2 Posters 68 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L
    L
    LoudLemur
    wrote last edited by
    #1

    We package several AI servers for the community store (text embeddings, reranking, speech, LLM inference). Two platform limits come up in almost every one, and both look cheap to lift. They sit alongside the gpu capability (topic 15756) and /dev/shm size (topic 15844) you have already agreed to, and are not a bump of either.

    1. A start period for the health check. Several model servers only bind their HTTP port after warming up the model, which takes tens of seconds on a CPU. During that window healthCheckPath gets connection-refused rather than a 503, and the app restart-loops before it is ever ready. A local docker run never shows this, because Docker does not health-check during warm-up, so it only appears on a real box. Our workaround is an nginx shim inside the image that answers /health at once and proxies everything else. It works, but every package has to rediscover it. Suggested shape: an optional healthCheckStartPeriod in seconds, like Docker's own HEALTHCHECK --start-period, during which failures are not counted.

    2. A per-app proxy read timeout. The reverse proxy cuts a request at about 60 seconds, and it cannot be set per app. A cold-model inference call, a long summary or a large synchronous job hits it, while the app's own server (gunicorn at 600 seconds, for example) would have waited. Streaming responses help where the app supports them, but many endpoints do not stream. Suggested shape: an optional proxyReadTimeout in seconds, with today's value as the default and a sensible maximum.

    Both are optional, both default to today's behaviour, and older boxes can ignore them, like other unknown fields.

    1 Reply Last reply
    0
    • jamesJ
      jamesJ
      james
      Staff
      wrote last edited by
      #2

      Hello @loudlemur

      @LoudLemur said:

      the app restart-loops before it is ever ready

      A failing health check does not cause the app to restart, there must be something else going on.

      L 1 Reply Last reply
      1
      • jamesJ james

        Hello @loudlemur

        @LoudLemur said:

        the app restart-loops before it is ever ready

        A failing health check does not cause the app to restart, there must be something else going on.

        L
        L
        LoudLemur
        wrote last edited by
        #3

        @james said:

        A failing health check does not cause the app to restart, there must be something else going on.

        @james You are right, thank you. We rechecked: the same change that added our shim also raised the memory limit, and the container was exiting 137, an OOM kill. The memory was the fix, not the shim. Please disregard request 1.

        Request 2 stands. A slow cold-model call completes via localhost inside the container, but through the reverse proxy it is cut at 60 seconds every time.

        jamesJ 1 Reply Last reply
        0
        • L LoudLemur

          @james said:

          A failing health check does not cause the app to restart, there must be something else going on.

          @james You are right, thank you. We rechecked: the same change that added our shim also raised the memory limit, and the container was exiting 137, an OOM kill. The memory was the fix, not the shim. Please disregard request 1.

          Request 2 stands. A slow cold-model call completes via localhost inside the container, but through the reverse proxy it is cut at 60 seconds every time.

          jamesJ
          jamesJ
          james
          Staff
          wrote last edited by james
          #4

          Hello @loudlemur

          @LoudLemur said:

          Request 2 stands. A slow cold-model call completes via localhost inside the container, but through the reverse proxy it is cut at 60 seconds every time.

          Just raising the timeout higher is not a resilient approach.
          One system might have a response time of 30s and on another maybe 60s+
          So no matter to what value the timeout is set, it can always reach the timeout.

          This sounds more like an design issue of the application.
          If something is still working it should inform the pending request about that and not simply do nothing until a timeout is reached.

          Something similar we just hit with https://forum.cloudron.io/topic/15914/large-app-backup-70gb-fails-at-rotate-copy-step-with-nosuchkey-ionos-s3-read-after-write-consistency-but-cloudron-has-no-retry
          Where the IONOS proxy in front of the S3 server simply did not respond, reached the timeout of 600s while it was in reality still working.
          This was because IONOS did not implement CompleteMultipartUpload of S3 correctly.
          While the CompleteMultipartUpload request could take several minutes to finalize and that is why S3 should periodically sends white space characters to keep the connection from timing out.
          They did not do that and thus proxy timeout was reached and caused all sort of issues.
          They could have increased the timeout to 1000s, 2000s or what ever value, but it would not have fixed the actual issue.

          The same can be applied here.
          If a slow cold-model takes time to complete, it should report it is still working instead of doing nothing causing the proxy to throw the timeout.

          1 Reply Last reply
          1
          • L
            L
            LoudLemur
            wrote last edited by
            #5

            Thank you, @james. You were right, and more right than we knew: please disregard request 2 as well.

            Before replying, we measured it instead of repeating our notes.

            • The platform does not cut at 60 seconds. The app proxy in nginxconfig.ejs sets proxy_read_timeout 3500, and it has done so since at least 8.3.0.
            • A test confirms it. On 10.0.4 we installed a small app whose endpoint stays completely silent before answering. Through the reverse proxy it answered 200 after 30, 75 and 150 seconds.
            • The 60 seconds we saw came from a client's own timeout. We blamed the proxy because a call to localhost worked, and that was an inference we never tested. It then spread through our notes into this request. Sorry for the noise, twice in one thread.

            Your design point stands, and the IONOS example makes it well: a longer timeout only moves the wall. Where an upstream can stream or report progress, our packages will say so and default to it, because real clients do time out. We are also correcting the documentation in our packages that repeated the wrong cause.

            1 Reply Last reply
            1
            • jamesJ
              jamesJ
              james
              Staff
              wrote last edited by
              #6

              Hello @loudlemur

              @LoudLemur said:

              Sorry for the noise, twice in one thread.

              No problem and I don't mind it at all.
              It is always good to exchange thoughts which leads to more knowledge for everyone and this also creates better and more stable software.

              1 Reply Last reply
              2

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search