文档

定时升级EIP实例临时带宽

功能背景

随着业务的不断发展和互联网应用场景的多样化,企业或个人用户在特定时间段内面临网络流量剧增的挑战变得尤为常见。这些流量高峰,如大规模促销活动、热门直播事件、重大新闻发布或季节性数据备份等场景,往往会导致原有带宽瞬间饱和,影响用户体验甚至导致服务短暂不可用。然而,传统网络带宽配置往往在流量骤增的特定时期无法满足需求,而长期维持高带宽配置则费用昂贵,这对于需要在成本控制和网络性能间取得平衡的用户而言,是一大挑战。

为解决上述问题,系统运维管理OOS推出了定时升级临时带宽的功能,此前系统运维管理已经支持了带宽临时升级功能,针对使用EIP实例带宽的场景,系统运维管理OOS新推出了EIP实例的定时升级带宽功能,该功能旨在提供一种灵活的解决方案,允许用户根据业务需求在特定时间段内临时增加带宽,提前对高峰业务做好规划,以应对预期的流量高峰,而在高峰过后自动降低带宽,以免产生额外成本。

关键特性

  • 定时触发:用户可预设具体日期和时间,按计划自动执行带宽升级操作,无需人工介入。

  • 自动回退:升级时长结束后,带宽自动恢复至原定标准,避免不必要的费用支出。

  • 成本优化:通过只在需要时升级带宽,用户能显著降低运营成本,实现资源的最优化利用。

  • 简洁操作:通过云服务平台提供的用户友好界面,几步操作即可完成定时升级设置。

应用场景

电商平台大促

在电商行业的年终大促或特定节假日促销活动期间,网站访问量急剧上升。通过定时升级带宽功能,电商平台可以在活动开始前预设带宽升级,保证顾客访问流畅,提升购物体验和成交率。

在线教育直播课程

在线教育平台在开展大型免费公开课或名师直播时,用户访问量会短时间内激增。利用本功能,平台可确保在直播期间提供足够的网络带宽,保障课程的顺利进行。

游戏发布与更新

游戏公司在发布新游戏或进行大型更新时,玩家集中下载更新包会引起带宽暴涨。通过定时升级带宽,游戏公司可以在此期间提供稳定的下载服务,提升用户体验。

周期性数据备份

对于需要进行大规模数据迁移或备份的企业,利用定时升级带宽功能可以在数据传输期间确保网络速度,缩短备份时间窗口,减少对业务运营的影响。

说明
  1. 仅付费类型为按量付费的实例支持EIP带宽临时升级。

  2. 仅能临时提升按固定带宽计费的公网带宽,不能提升按使用流量计费的公网带宽。

操作步骤

  1. 登录OOS控制台

  2. 在左侧导航栏找到“自动化任务-公共任务模板”,搜索"ACS-VPC-ScheduleToUpgradeEipBandwidth",点击创建执行。

image.png

  1. 点击下一步: 设置参数,选择定时类型。

这里定时类型有“立即执行、仅在指定时间执行一次、周期性重复执行”三种方式。其中“立即执行”会在创建任务后立即进行重启操作,“仅在指定时间执行一次”只会在您设定的某个时间点执行一次,“周期性重复执行”则会安装一定的规则重复执行,如每一小时执行一次。

image.png

  1. 设置EIP实例所在地域和EIP实例ID、填写需要修改的带宽值带宽升级时间(最少1小时),点击确定-创建,此时定时升级EIP带宽的任务就创建完成了,当到达设定的时间后就会自动对EIP带宽进行升级,并且在持续设定的时间后降低到原有带宽。

image.png

附录

执行流程图

整体执行流程图:

image.png

其中升级EIP实例带宽流程

image.png

模板

上述步骤中使用的模板“ACS-VPC-ScheduleToUpgradeEipBandwidth”内容如下(模板链接):

FormatVersion: OOS-2019-06-01
Description:
  en: Schedule to upgrade EIP bandwidth
  zh-cn: 定时升级EIP实例临时带宽
  name-en: ACS-VPC-ScheduleToUpgradeEipBandwidth
  name-zh-cn: 定时升级EIP实例临时带宽
  categories:
    - time_trigger
Parameters:
  TimerTrigger:
    Type: Json
    Label:
      en: TimerTrigger
      zh-cn: 定时类型
    AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
    AssociationPropertyMetadata:
      MinuteInterval: 30
  RegionId:
    Type: String
    Label:
      en: The id of region
      zh-cn: 地域ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  AllocationId:
    Type: List
    Label:
      en: TargetEIPInstance
      zh-cn: 目标EIP实例
  Bandwidth:
    Label:
      en: Bandwidth
      zh-cn: 带宽
    Description:
      en: The peak bandwidth of EIP needs to be modified. The value is:1~500. It is billed based on fixed bandwidth, in Mbps.
      zh-cn: 需要修改 EIP 的带宽峰值,取值:1~500,按固定带宽计费,单位为 Mbps。
    Type: Number
    MinValue: 1
    MaxValue: 500
  DurationHour:
    Label:
      en: DurationHour
      zh-cn: 带宽升级持续时间
    Description:
      zh-cn: 单位:小时。持续时间最少1小时
      en: Unit:Hour. The bandwidth upgrade should last at least 1 hours
    Type: Number
    MinValue: 1
    MaxValue: 24
    Default: 1
  RateControl:
    Label:
      en: RateControl
      zh-cn: 任务执行的并发比率
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: The RAM role to be assumed by OOS
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: GetEipInstance
    Description:
      en: Get the EIP instance
      zh-cn: 获取EIP实例
    Action: ACS::ExecuteAPI
    Properties:
      Service: VPC
      API: DescribeEipAddresses
      Parameters:
        RegionId: '{{ RegionId }}'
        AllocationId:
          Fn::Join:
            - ','
            - '{{ AllocationId }}'
    Outputs:
      AllocationIds:
        Type: List
        ValueSelector: .EipAddresses.EipAddress[].AllocationId
  - Name: UpgradeEipAddressBandwidth
    Action: ACS::VPC::UpgradeEipBandwidth
    Description:
      en: Upgrade EIP instance bandwidth
      zh-cn: 升级EIP实例的带宽
    Properties:
      RegionId: '{{ RegionId }}'
      AllocationId: '{{ ACS::TaskLoopItem }}'
      Bandwidth: '{{ Bandwidth }}'
      DurationHour: '{{ DurationHour }}'
    Loop:
      RateControl: '{{ RateControl }}'
      Items: '{{ GetEipInstance.AllocationIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - TimerTrigger
        Label:
          default:
            zh-cn: 定时设置
            en: Timer Trigger Configure
      - Parameters:
          - RegionId
          - AllocationId
          - Bandwidth
          - DurationHour
        Label:
          default:
            zh-cn: 选择实例
            en: Select ECS Instances
      - Parameters:
          - RateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 高级选项
            en: Control Options

其中Action: ACS::VPC::UpgradeEipBandwidth内容如下:

FormatVersion: OOS-2019-06-01
Description:
  en: Upgrading the temporary bandwidth of an EIP instance
  zh-cn: 升级EIP实例临时带宽
  name-en: ACS::VPC::UpgradeEipBandwidth
  name-zh-cn: 升级EIP实例临时带宽
Parameters:
  RegionId:
    Type: String
    Label:
      en: The id of region
      zh-cn: 地域ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  AllocationId:
    Type: String
    Label:
      en: TargetEIPInstance
      zh-cn: 目标EIP实例
  Bandwidth:
    Label:
      en: Bandwidth
      zh-cn: 带宽
    Description:
      en: Unit:Mbps
      zh-cn: 单位:Mbps
    Type: Number
    MinValue: 1
    MaxValue: 200
    Default: 10
  DurationHour:
    Label:
      en: DurationHour
      zh-cn: 带宽升级持续时间
    Description:
      zh-cn: 单位:小时。持续时间最少1小时
      en: Unit:Hour. The bandwidth upgrade should last at least 1 hours
    Type: Number
    MinValue: 1
    Default: 1
Tasks:
- Name: GetEipInstance
  Description:
    en: Views the EIP instances
    zh-cn: 获取EIP实例
  Action: ACS::ExecuteAPI
  Properties:
    Service: VPC
    API: DescribeEipAddresses
    Parameters:
      RegionId: '{{ RegionId }}'
      AllocationId: '{{ AllocationId }}'
  Outputs:
    Bandwidth:
      Type: String
      ValueSelector: .EipAddresses.EipAddress[].Bandwidth
- Name: UpgradeEipAddressBandwidth
  Action: ACS::ExecuteAPI
  Description:
    en: Upgrade EIP instance bandwidth
    zh-cn: 升级EIP实例的带宽
  Properties:
    Service: VPC
    API: ModifyEipAddressAttribute
    Parameters:
      RegionId: '{{ RegionId }}'
      AllocationId: '{{ AllocationId }}'
      Bandwidth: '{{ Bandwidth }}'
- Name: DurationHour
  Action: ACS::Sleep
  Description:
    en: Bandwidth upgrade duration
    zh-cn: 带宽升级持续时间
  Properties:
    Duration: '{{ DurationHour }}H'
- Name: RecoverEipAddressBandwidth
  Action: ACS::ExecuteAPI
  Description:
    en: Recover EIP instance bandwidth
    zh-cn: 恢复EIP实例的带宽
  Properties:
    Service: VPC
    API: ModifyEipAddressAttribute
    Parameters:
      RegionId: '{{ RegionId }}'
      AllocationId: '{{ AllocationId }}'
      Bandwidth: '{{ GetEipInstance.Bandwidth }}'
  • 本页导读