Skip to main content

Running Mode and Scaling

This document introduces the running mode and scaling mechanism of cloud hosting, helping you choose the most suitable configuration plan for your business scenario.

Operation Mode Overview

Cloud Hosting provides the following running modes to cater to different business needs:

Operation Mode Detailed Explanation

Always Automatic Scaling

In this mode, the cloud hosting service automatically adjusts the number of instances based on the actual load:

  • Scaling Range: The number of instances can be automatically adjusted between 0-10.
  • Trigger Metric: You can select CPU utilization, memory utilization, or both as scaling trigger conditions.
  • Advantages: Maximizes resource savings, automatically handles traffic fluctuations, and reduces operational costs.

This mode is particularly suitable for business scenarios with significant or unpredictable traffic fluctuations.

Continuous Operation

In Continuous Operation mode, the service maintains a fixed number of running instances and does not perform automatic scaling.

Applicable Scenarios:

  • Service traffic is relatively stable with no significant peaks or troughs.
  • Ensures the service remains in a warm start state at all times, thus preventing cold start latency.
  • Core business with extremely high requirements for service availability

In this mode, you need to estimate the required number of instances based on business peak loads to ensure stable service operation.

Daytime Continuous Operation with Nighttime Automatic Scaling

This mode combines the advantages of Continuous Operation and automatic scaling:

  • Daytime Hours (8:00-24:00): Maintains a specified number of instances in continuous operation.
  • Nighttime Hours (0:00-8:00): Enables automatic scaling, allowing instances to scale down to 0.

This approach fits business scenarios with higher traffic during work hours and significantly decreased traffic during non-work hours, such as internal enterprise systems, office applications, etc.

Custom Icons

Customization Mode provides the most flexible configuration options, including:

  • Automatic Scaling:

    • Configure the maximum and minimum quantity of instances
    • Select CPU or memory utilization as the trigger condition
    • Set the trigger threshold and monitoring interval
  • Scheduled Scale-out:

    • Maintain the minimum number of instances within specified time periods
    • The number of instances for scheduled scale-out must exceed the minimum number of instances set for automatic scaling.
    • During scheduled periods, automatic scale-out can still occur but will not exceed the maximum instance limit

This mode is suitable for scenarios with predictable traffic patterns that require granular resource control, such as e-commerce promotions or scheduled task processing.

Manual Instance Start/Stop

In manual start/stop mode, instances are entirely manually controlled and do not scale automatically:

  • Instances do not automatically scale in due to lack of requests
  • Instances will not automatically scale out due to increased load
  • All instance modifications must be performed manually via the console or API

Operation Method:

  • Start Instance:

    • Perform the "Start Instance" operation in the console version list
    • Start instance via API call
    • Each console operation starts one instance; starting multiple instances requires multiple operations.
  • Stop Instance:

    • Perform the "Stop Instance" operation in the console instance list
    • Stop instance via API call
    • You can select specified instances to perform the stop operation

This mode is suitable for scenarios requiring full control over the instance lifecycle, such as development and testing environments or specific business requirements.

Instance resource usage

For manual instance start/stop, if you forget to stop the instance after starting it, unnecessary resource waste may occur, resulting in higher billing costs.

Scaling Out and In in Detail

Scaling Out Instances Process

Instance scaling consists of two stages:

  1. From 0 to 1 Scaling (Cold Start):

    • Trigger condition: The service receives a new request after being fully scaled in
    • Start instance via API call
    • Factors affecting time consumption: platform resource status, image size, business code startup time, etc.
    • User experience: The first request may experience some delay
  2. Scaling from 1 to Multiple Instances:

    • Trigger condition: The average CPU/memory utilization of existing instances reaches or exceeds the configured scaling-out threshold.
    • Process: Start a new instance and add it to the load balancer once ready
    • Continuous monitoring: If the threshold is still exceeded after the detection cycle, additional scaling out will be performed
    • Limitation: The number of instances does not exceed the configured maximum value

Instance Scaling Down Mechanism

  • Trigger condition: No access requests, no traffic flow, and idle for 10 minutes
  • Scale-in behavior: Reclaim and destroy idle instances
  • Minimum instances: When the minimum instance count is set to 0, scaling down to zero instances is possible
  • Subsequent requests: New requests after full scale-in will trigger the cold start process

Instance Termination Instructions

  • Instances will be completely destroyed after scale-in
  • Temporary files, in-memory data, etc. within the instance will be cleared together
  • Important: Ensure your application is stateless, and all persistent data should be stored in external storage services

Choose the Appropriate Operation Mode

Operation ModeApplicable ScenariosCost EfficiencyResponse Speed
Always Automatic ScalingLarge traffic fluctuations, unpredictableOptimalPossible cold start delay
Continuous OperationStable traffic, high availability requirementsFixed, higherOptimal (no cold start)
Daytime Continuous Operation with Nighttime Automatic ScalingWork-hour intensive applicationsBetterOptimal during work hours, possible delay during off-peak
CustomClear traffic patterns, requires fine-grained controlOptimizableCan be optimized based on configuration
Manual Instance Start/StopDevelopment and testing, special business requirementsFull controlDepends on timeliness of manual operations