Background information
In today's data-driven business landscape, Tair (Redis® OSS-Compatible) has become a pivotal component of the critical infrastructure of many enterprises thanks to its excellent performance and flexibility. Tair (Redis® OSS-Compatible) is widely used in a variety of data-intensive and latency-sensitive scenarios, such as caching, session management, and message queuing. It makes significant contributions to business continuity and user experience improvement. However, during large-scale marketing campaigns, product launches, or other planned events that attract high traffic, the standard bandwidth configuration may face considerable challenges. At such crucial times, even minimal latency may lead to adverse market impacts and losses of user retention for enterprises.
To resolve the preceding issue, CloudOps Orchestration Service (OOS) provides a feature that enables scheduled upgrades to the temporary bandwidth of Tair (Redis® OSS-Compatible) instances. You can also use OOS to Temporarily upgrade the bandwidth or Schedule temporary bandwidth upgrades for EIPs. This feature allows you to plan and execute scheduled bandwidth upgrades based on business load forecasts. This ensures the performance and stability of your applications at critical moments and optimizes costs.
Key features
Scheduled triggering: You can preset specific dates and times to automatically trigger bandwidth upgrades based on your business requirements.
Automatic reversion: Upon completion of the specified upgrade duration, the bandwidth automatically reverts to the original value. This effectively prevents cost wastes during off-peak hours.
Cost optimization: The bandwidth is upgraded only on demand, so enterprises can significantly reduce operational costs while maintaining service quality.
Streamlined operation: The user-friendly user interface (UI) design allows you to complete the bandwidth upgrade process in just a few steps.
Scenarios
E-commerce platform promotions: Schedule bandwidth upgrades during major promotional events to handle the surge in user traffic.
Large-scale game updates: Upgrade the bandwidth during new game version releases or major updates to ensure a seamless download experience for players.
Holiday traffic spikes: Plan ahead for bandwidth enhancement to accommodate the expected surge in visits during holidays.
Data-intensive tasks: Temporarily increase the bandwidth to expedite the completion of tasks such as large-scale data migrations or analytical operations.
Procedure
Log on to the OOS console.
In the left-side navigation pane, choose Automated Task > Public Template. On the Public Template page, enter ACS-Redis-ScheduleToUpgradeInstanceBandwidth in the search box. Find the ACS-Redis-ScheduleToUpgradeInstanceBandwidth template and click Create Execution.
On the Create Task page, click Next Step: Parameter Settings. In the Parameter Settings step, configure the TimerTrigger parameter in the Timer Trigger Configure section.
You can set the TimerTrigger parameter to Execute Now, Executed Once at the Specified Time, or Executed Periodically. If you select Execute Now, the scheduled bandwidth upgrade task is executed immediately after it is created. If you select Executed Once at the Specified Time, the scheduled bandwidth upgrade task is executed only once at the specified point in time. If you select Executed Periodically, the scheduled bandwidth upgrade task is periodically executed based on the scheduled time. For example, you can specify that the scheduled bandwidth upgrade task is executed on an hourly basis.
In the Select Instances section, specify the region in which your Tair (Redis® OSS-Compatible) instances reside. Select one of the following options for TargetInstance to find one or more Tair (Redis® OSS-Compatible) instances that you want to manage: Manually Select Instances, Specify Instance Tags, Specify Resource Group, Upload CSV File, and Select All. Configure the Bandwidth and DurationHour parameters. The minimum bandwidth upgrade duration is 1 hour. In the Control Options section, select a role that has access to the Tair (Redis® OSS-Compatible) instances, and click Next Step: OK. Then, click Create in the next step. Till now, the scheduled bandwidth upgrade task is created for the Tair (Redis® OSS-Compatible) instances. When the specified time arrives, the system automatically upgrades the bandwidth of the Tair (Redis® OSS-Compatible) instances. Upon completion of the upgrade duration, the bandwidth automatically reverts to the original value.
Appendix
Execution flowchart
The following figure shows the entire execution process.
The following figure shows the process of upgrading the bandwidth of Tair (Redis® OSS-Compatible) instances.
Template
The following section describes the content of the ACS-Redis-ScheduleToUpgradeInstanceBandwidth template that is used in this example:
FormatVersion: OOS-2019-06-01
Description:
en: Scheduled upgrade of the temporary bandwidth of a Redis instance
name-en: ACS-Redis-ScheduleToUpgradeInstanceBandwidth
Parameters:
RegionId:
Type: String
Label:
en: RegionId
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
Targets:
Type: Json
Label:
en: TargetInstance
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: ALIYUN::Redis::Instance
RegionId: regionId
TimerTrigger:
Type: Json
Label:
en: TimerTrigger
AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
AssociationPropertyMetadata:
MinuteInterval: 30
Bandwidth:
Type: Number
Label:
en: Bandwidth
Description:
en: Unit:MB/s. The maximum incoming bandwidth is 6 times the default bandwidth of this instance specification, but the upper limit is 192MB/s. For example, the default bandwidth of an instance is 10 MB/s, and the value range of this parameter is 0~60.
MinValue: 1
MaxValue: 192
DurationHour:
Label:
en: DurationHour
Description:
en: Unit:Hour. The bandwidth upgrade should last at least 1 hours
Type: Number
MinValue: 1
Default: 1
RateControl:
Label:
en: RateControl
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: TimerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers a task as scheduled by specifying type and expression
Properties:
Type:
Fn::Select:
- type
- '{{ TimerTrigger }}'
Expression:
Fn::Select:
- expression
- '{{ TimerTrigger }}'
EndDate:
Fn::Select:
- endDate
- '{{ TimerTrigger }}'
TimeZone:
Fn::Select:
- timeZone
- '{{ TimerTrigger }}'
- Name: GetInstance
Description:
en: Get the redis instances
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::Redis::Instance
RegionId: '{{ RegionId }}'
Filters:
- '{{ Targets }}'
Outputs:
InstanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: UpgradeRedisInstanceBandwidth
Action: ACS::Redis::UpgradeRedisInstanceBandwidth
Description:
en: Modify redis instance bandwidth
Properties:
RegionId: '{{ RegionId }}'
InstanceId: '{{ ACS::TaskLoopItem }}'
Bandwidth: '{{ Bandwidth }}'
DurationHour: '{{ DurationHour }}'
Loop:
RateControl: '{{ RateControl }}'
Items: '{{ GetInstance.InstanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- TimerTrigger
Label:
default:
en: Timer Trigger Configure
- Parameters:
- RegionId
- Targets
- Bandwidth
- DurationHour
Label:
default:
en: Select Instances
- Parameters:
- RateControl
- OOSAssumeRole
Label:
default:
en: Control Options
The following section describes the content of Action: ACS::Redis::UpgradeRedisInstanceBandwidth:
FormatVersion: OOS-2019-06-01
Description:
en: Upgrade of the temporary bandwidth of a Redis instance
name-en: ACS::Redis::UpgradeRedisInstanceBandwidth
Parameters:
RegionId:
Type: String
Label:
en: RegionId
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
InstanceId:
Type: String
Label:
en: InstanceId
Bandwidth:
Type: Number
Label:
en: Bandwidth
Description:
en: Unit:MB/s. The maximum incoming bandwidth is 6 times the default bandwidth of this instance specification, but the upper limit is 192MB/s. For example, the default bandwidth of an instance is 10 MB/s, and the value range of this parameter is 0~60.
MinValue: 1
MaxValue: 192
DurationHour:
Label:
en: DurationHour
Description:
en: Unit:Hour. The bandwidth upgrade should last at least 1 hours
Type: Number
MinValue: 1
Default: 1
Tasks:
- Name: UpgradeRedisInstanceBandwidth
Action: ACS::ExecuteApi
Description:
en: Upgrade redis instance bandwidth
Properties:
Service: r-kvstore
API: EnableAdditionalBandwidth
Parameters:
RegionId: '{{ RegionId }}'
InstanceId: '{{ InstanceId }}'
Bandwidth: '{{ Bandwidth }}'
AutoPay: true
- Name: DurationHour
Action: ACS::Sleep
Description:
en: Bandwidth upgrade duration
Properties:
Duration: '{{ DurationHour }}H'
- Name: RecoverRedisInstanceBandwidth
Action: ACS::ExecuteAPI
Description:
en: Recover redis instance bandwidth
Properties:
Service: r-kvstore
API: EnableAdditionalBandwidth
Parameters:
RegionId: '{{ RegionId }}'
InstanceId: '{{ InstanceId }}'
Bandwidth: 0
AutoPay: true