pub enum ScalerType {
QueueDelay,
RequestCount,
}Expand description
Scaling strategy for serverless endpoint worker management.
Determines how the serverless infrastructure responds to incoming request load by automatically scaling the number of active workers up or down.
§Strategies
§Queue Delay (QueueDelay)
Latency-optimized scaling that prioritizes response time consistency.
- Scales up when requests wait longer than the configured threshold
- Maintains responsive service with predictable latency characteristics
- Best for interactive applications, real-time inference, SLA-sensitive workloads
- Higher baseline costs to ensure responsiveness
§Request Count (RequestCount)
Throughput-optimized scaling that balances load efficiently across workers.
- Maintains approximately
queue_size / scaler_valueworkers - Optimizes for cost efficiency and overall throughput
- Best for batch processing, background tasks, cost-sensitive workloads
- May have higher latency during traffic spikes
§Examples
use runpod_sdk::model::ScalerType;
// For real-time AI inference requiring <3s response times
let latency_optimized = ScalerType::QueueDelay;
// scaler_value = 2 means scale up if any request waits >2 seconds
// For batch image processing where cost matters more than speed
let cost_optimized = ScalerType::RequestCount;
// scaler_value = 10 means maintain 1 worker per 10 queued requestsVariants§
QueueDelay
Queue delay-based scaling - prioritizes response time consistency. Scales up when requests wait longer than the threshold.
RequestCount
Request count-based scaling - optimizes for throughput and cost. Maintains workers proportional to queue depth.
Trait Implementations§
Source§impl Clone for ScalerType
impl Clone for ScalerType
Source§fn clone(&self) -> ScalerType
fn clone(&self) -> ScalerType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScalerType
impl Debug for ScalerType
Source§impl Default for ScalerType
impl Default for ScalerType
Source§fn default() -> ScalerType
fn default() -> ScalerType
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ScalerType
impl<'de> Deserialize<'de> for ScalerType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ScalerType
impl Display for ScalerType
Source§impl FromStr for ScalerType
impl FromStr for ScalerType
Source§impl PartialEq for ScalerType
impl PartialEq for ScalerType
Source§impl Serialize for ScalerType
impl Serialize for ScalerType
Source§impl TryFrom<&str> for ScalerType
impl TryFrom<&str> for ScalerType
impl Copy for ScalerType
impl Eq for ScalerType
impl StructuralPartialEq for ScalerType
Auto Trait Implementations§
impl Freeze for ScalerType
impl RefUnwindSafe for ScalerType
impl Send for ScalerType
impl Sync for ScalerType
impl Unpin for ScalerType
impl UnwindSafe for ScalerType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.