Re:Show HN: Clace – Application Server with support for scal...
by ttymck on Wednesday September 11, 2024 @05:44PM
(#41515596)
Scale to zero makes me think it might be useful to specify a time window (cron?) where scaling to zero is allowed, i.e. 6pm-8am it can scale to zero but during the work day never fully scale to zero. Makes me wonder if this is a common pattern.
[ Parent
| on HN ]
Re:Show HN: Clace – Application Server with support for scal...
by ajayvk on Wednesday September 11, 2024 @05:54PM
(#41515660)
For webapps which are accessed as web pages or through API, looking at the API activity will indicate whether the app is being actively used. Clace currently uses no new API calls with last 3 minutes as indicating idleness. This is aggressive, it can be tuned as required https://clace.io/docs/container/config/. For apps using websockets or server-sent events, the API activity check will not be accurate.
For background jobs and cron jobs, some kind of cron job can be defined in the app, to wake up the container. This is not supported currently. If an app has background jobs or idle check is not accurate, the auto-pause can be disabled.
Re:Show HN: Clace – Application Server with support for scal...
by ttymck on Thursday September 12, 2024 @10:35PM
(#41527592)
Right, I am suggesting a feature to disable the idleness check during a window of the day
Re:Show HN: Clace – Application Server with support for scal...
by ajayvk on Friday September 13, 2024 @01:25PM
(#41533243)
This could be done using a system cron job which runs
clace app update-metadata conf --promote container.idle_shutdown_secs=180 /myapp
at every 6pm and then runs clace app update-metadata conf --promote container.idle_shutdown_secs=0 /myapp
at 8am. idle_shutdown_secs being zero disables the shutdown. Using all as the last arg will update for all apps.