您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

自动增加 Azure 事件中心吞吐量单位Automatically scale up Azure Event Hubs throughput units

Azure 事件中心是高度可缩放的数据流式处理平台。Azure Event Hubs is a highly scalable data streaming platform. 因此,开始使用该服务后事件中心使用量通常会增加。As such, Event Hubs usage often increases after starting to use the service. 这样的使用量需要增加预先确定的吞吐量单位,从而扩展事件中心和处理更大的传输速率。Such usage requires increasing the predetermined throughput units to scale Event Hubs and handle larger transfer rates. 事件中心的自动膨胀功能可自动增加吞吐量单位数,以便满足使用量需求。The Auto-inflate feature of Event Hubs automatically scales up the number of throughput units to meet usage needs. 增加吞吐量单位数可防止出现限制情况,在这些情况下:Increasing throughput units prevents throttling scenarios, in which:

  • 数据入口速率超过设置的吞吐量单位数。Data ingress rates exceed set throughput units.
  • 数据出口请求速率超过设置的吞吐量单位数。Data egress request rates exceed set throughput units.

自动膨胀的工作原理How Auto-inflate works

事件中心流量由吞吐量单位控制。Event Hubs traffic is controlled by throughput units. 单个吞吐量单位允许入口量为 1 MB/秒,出口量是其两倍。A single throughput unit allows 1 MB per second of ingress and twice that amount of egress. 标准事件中心可以配置 1-20 个吞吐量单位。Standard event hubs can be configured with 1-20 throughput units. 利用自动膨胀,可从所需吞吐量单位的最小值开始。Auto-inflate enables you to start small with the minimum required throughput units. 然后此功能会自动将所需吞吐量单位增加到最大值,具体取决于增加的流量。The feature then scales automatically to the maximum limit of throughput units you need, depending on the increase in your traffic. 自动膨胀具有以下优势:Auto-inflate provides the following benefits:

  • 高效的缩放机制,可从少量开始并随流量增长而增加。An efficient scaling mechanism to start small and scale up as you grow.
  • 自动增加到指定上限,没有限制问题。Automatically scale to the specified upper limit without throttling issues.
  • 更好地控制缩放,你可控制缩放的时间和程度。More control over scaling, as you control when and how much to scale.

在命名空间上启用自动膨胀Enable Auto-inflate on a namespace

可使用下列方法之一在事件中心命名空间上启用或禁用自动膨胀:You can enable or disable Auto-inflate on an Event Hubs namespace by using either of the following methods:

  1. Azure 门户The Azure portal.
  2. Azure 资源管理器模板。An Azure Resource Manager template.

通过门户启用自动膨胀Enable Auto-inflate through the portal

创建事件中心命名空间时,可启用自动膨胀功能:You can enable the Auto-inflate feature when creating an Event Hubs namespace:

启用此选项后,可从少量吞吐量单位开始并随所需使用量的增长而增加。With this option enabled, you can start small on your throughput units and scale up as your usage needs increase. 膨胀的上限不会立即影响定价,定价取决于每小时使用的吞吐量单位数。The upper limit for inflation does not immediately affect pricing, which depends on the number of throughput units used per hour.

还可以使用门户中“设置”窗格上的“缩放”选项启用自动膨胀:You can also enable Auto-inflate using the Scale option on the settings pane in the portal:

使用 Azure 资源管理器模板启用自动膨胀Enable Auto-Inflate using an Azure Resource Manager template

可在 Azure 资源管理器模板部署期间启用自动膨胀。You can enable Auto-inflate during an Azure Resource Manager template deployment. 例如,将 isAutoInflateEnabled 属性设置为“true”并将 maximumThroughputUnits 设置为 10。For example, set the isAutoInflateEnabled property to true and set maximumThroughputUnits to 10.

"resources": [
        {
            "apiVersion": "2017-04-01",
            "name": "[parameters('namespaceName')]",
            "type": "Microsoft.EventHub/Namespaces",
            "location": "[variables('location')]",
            "sku": {
                "name": "Standard",
                "tier": "Standard"
            },
            "properties": {
                "isAutoInflateEnabled": true,
                "maximumThroughputUnits": 10
            },
            "resources": [
                {
                    "apiVersion": "2017-04-01",
                    "name": "[parameters('eventHubName')]",
                    "type": "EventHubs",
                    "dependsOn": [
                        "[concat('Microsoft.EventHub/namespaces/', parameters('namespaceName'))]"
                    ],
                    "properties": {},
                    "resources": [
                        {
                            "apiVersion": "2017-04-01",
                            "name": "[parameters('consumerGroupName')]",
                            "type": "ConsumerGroups",
                            "dependsOn": [
                                "[parameters('eventHubName')]"
                            ],
                            "properties": {}
                        }
                    ]
                }
            ]
        }
    ]

有关完整的模板,请参阅 GitHub 上的创建事件中心命名空间和启用膨胀模板For the complete template, see the Create Event Hubs namespace and enable inflate template on GitHub.

后续步骤Next steps

访问以下链接可以了解有关事件中心的详细信息:You can learn more about Event Hubs by visiting the following links: