Modal documentation - Scaling out (autoscaler parameters, dynamic updates)
Fields
sources/dep-modal-scale-docsNotes
Fetched 2026-10-04. 'Every Modal Function corresponds to an autoscaling pool of containers ... By default, Modal Functions will scale to zero when there are no inputs to process.' Four parameters: max_containers, min_containers ('The minimum number of containers that should be kept warm, even when the Function is inactive'), buffer_containers, scaledown_window. 'In general, these settings allow you to trade off cost and latency. Maintaining a larger warm pool or idle buffer will increase costs but reduce the chance that inputs will need to wait for a new container to start.' Autoscaler settings are MUTABLE AT RUNTIME without redeploy via Function.update_autoscaler(), and the docs give a canonical pattern: a cron-scheduled function that raises min_containers before a known peak and lowers it afterwards (example increases to 4 at 06:00 America/New_York and drops to 0 at 22:00). For a modal.Cls, update_autoscaler() is per-instance and controls only containers serving that specific set of parameters - which is how you warm one model version without paying for the others. Stated caveat: autoscaler settings 'will revert to the configuration in the function decorator the next time you deploy the App.'
Cross-references
This record references no other records.