▾ modified deploy/modal/modal_app.py +4 -3 Viewed
@@ -151,9 +151,10 @@ def _snapshot_loop(stop: threading.Event) -> None: 151 151 # Single writer: SQLite tolerates exactly one process writing these files, 152 152 # and the snapshot scheme assumes one container owns the data. 153 153 max_containers = 1 , 154 - # Glean's background workers (Jetstream consumer, PDS sync, clustering, 155 - # feed fetch) only run while a container is alive, so keep one alive. 156 - min_containers = 1 , 154 + # Scale to zero when idle: Glean's background workers (Jetstream consumer, 155 + # PDS sync, clustering, feed fetch) only run while a container is alive, so 156 + # they pause between requests and resume on the next one. 157 + min_containers = 0 , 157 158 scaledown_window = 1200 , 158 159 timeout = 24 * 60 * 60 , 159 160 cpu = 2 ,
@@ -151,9 +151,10 @@ def _snapshot_loop(stop: threading.Event) -> None: 151 # Single writer: SQLite tolerates exactly one process writing these files, 151 # Single writer: SQLite tolerates exactly one process writing these files, 152 # and the snapshot scheme assumes one container owns the data. 152 # and the snapshot scheme assumes one container owns the data. 153 max_containers = 1 , 153 max_containers = 1 , 154 - # Glean's background workers (Jetstream consumer, PDS sync, clustering, 154 + # Scale to zero when idle: Glean's background workers (Jetstream consumer, 155 - # feed fetch) only run while a container is alive, so keep one alive. 155 + # PDS sync, clustering, feed fetch) only run while a container is alive, so 156 - min_containers = 1 , 156 + # they pause between requests and resume on the next one. 157 + min_containers = 0 , 157 scaledown_window = 1200 , 158 scaledown_window = 1200 , 158 timeout = 24 * 60 * 60 , 159 timeout = 24 * 60 * 60 , 159 cpu = 2 , 160 cpu = 2 ,