By Yicheng
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 of Elastic Compute Service (ECS) instances or schedule temporary bandwidth upgrades for elastic IP addresses (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.
1. Log on to the OOS console.
2. 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.
3. 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.
4. 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.
The following figure shows the entire execution process.
The following figure shows the process of upgrading the bandwidth of Tair (Redis® OSS-Compatible) instances.
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
CloudOps Orchestration Service Use Case: Schedule Temporary Bandwidth Upgrades for EIPs
祎程 - August 22, 2024
Alibaba Cloud Community - August 30, 2024
Alibaba Clouder - January 21, 2021
Alibaba Cloud Community - March 25, 2022
Alibaba Clouder - December 19, 2018
Alibaba Clouder - March 24, 2021
CloudOps Orchestration Service is an automated operations and maintenance (O&M) service provided by Alibaba Cloud.
Learn MoreA key value database service that offers in-memory caching and high-speed access to applications hosted on the cloud
Learn MoreTair is a Redis-compatible in-memory database service that provides a variety of data structures and enterprise-level capabilities.
Learn MoreAlibaba Cloud provides products and services to help you properly plan and execute data backup, massive data archiving, and storage-level disaster recovery.
Learn More