From b1118e5ac6478a3d9f1919d75728456f0c27af41 Mon Sep 17 00:00:00 2001 From: Michael Waskom Date: Thu, 6 Feb 2025 12:23:19 -0500 Subject: [PATCH] Add protos for AutoscalerSettings and request where we'll use it (#2841) --- modal_proto/api.proto | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modal_proto/api.proto b/modal_proto/api.proto index f855c0188..11ddfd690 100644 --- a/modal_proto/api.proto +++ b/modal_proto/api.proto @@ -563,6 +563,22 @@ message Asgi { } } +message AutoscalerSettings { + // A collection of user-configurable settings for Function autoscaling + // These are used for static configuration and for dynamic autoscaler updates + + // Minimum containers when scale-to-zero is not deisired; pka "keep_warm" or "warm_pool_size" + optional uint32 min_containers = 1; + // Limit on the number of containers that can be running for each Function; pka "concurrency_limit" + optional uint32 max_containers = 2; + // Additional container to spin up when Function is active + optional uint32 buffer_containers = 3; + // Currently unused; a placeholder in case we decide to expose scaleup control to users + optional uint32 scaleup_window = 4; + // Maximum amount of time a container can be idle before being scaled down, in seconds; pka "container_idle_timeout" + optional uint32 scaledown_window = 5; +} + message BaseImage { string image_id = 1; string docker_tag = 2; @@ -1675,6 +1691,7 @@ message FunctionStats { message FunctionUpdateSchedulingParamsRequest { string function_id = 1; uint32 warm_pool_size_override = 2; + AutoscalerSettings settings = 3; } message FunctionUpdateSchedulingParamsResponse {}