自動相應增加 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 by increasing 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.

「事件中樞」服務可在負載超過最低閾值時增加輸送量,不會有任何要求因為發生 ServerBusy 錯誤而失敗。The Event Hubs service increases the throughput when load increases beyond the minimum threshold, without any requests failing with ServerBusy errors.

自動擴充的運作方式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 you choose. 該功能接著會根據流量的提升,自動擴充至您所需的輸送量單位上限。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, because you control when and how much to scale.

在命名空間上啟用自動擴充Enable Auto-inflate on a namespace

您可以使用下列其中一種方法,在標準層事件中樞的命名空間上啟用或停用自動擴充:You can enable or disable Auto-inflate on a Standard tier Event Hubs namespace by using either of the following methods:

注意

基本層事件中樞命名空間不支援自動擴充。Basic tier Event Hubs namespaces do not support Auto-inflate.

透過入口網站啟用自動擴充Enable Auto-inflate through the portal

在建立時啟用Enable at the time of creation

您可以在建立事件中樞命名空間時,啟用「自動擴充」功能:You can enable the Auto-inflate feature when creating an Event Hubs namespace:

在建立事件中樞命名空間時啟用自動擴充功能

啟用此選項時,您可以於開始時使用較小的輸送量單位,並隨著使用量需求的提升進行相應增加。With this option enabled, you can start small with 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.

為現有的事件中樞啟用自動擴充功能Enable auto-inflate for an existing event hub

您也可以依據下列指示,啟用「自動擴充」功能並修改其設定:You can also enable the Auto-inflate feature and modify its settings by using the following instructions:

  1. 在 [事件中樞命名空間] 頁面上,於 [自動擴充輸送量單位] 底下選取 [已停用]。On the Event Hubs Namespace page, select Disabled under Auto-inflate throughput units.

    在 [事件中樞命名空間] 頁面上選取輸送量單位

  2. 在 [調整規模設定] 頁面中,選取 [啟用] 的核取方塊 (如果未啟用自動調整規模功能)。In the Scale Settings page, select the checkbox for Enable (if the autoscale feature wasn't enabled).

    選取 [啟用]

  3. 輸入輸送量單位數目上限,或使用捲軸來設定值。Enter the maximum number of throughput units or use the scrollbar to set the value.

  4. (選擇性) 更新此頁面上半部的輸送量單位數目下限(optional) Update the minimum number of throughput units at the top of this page.

注意

當您套用自動擴充設定以增加輸送量單位時,「事件中樞」服務會發出診斷記錄,您可以為其提供有關輸送量增加原因與時間的相關資訊。When you apply the auto-inflate configuration to increase throughput units, the Event Hubs service emits diagnostic logs that give you information about why and when the throughput increased. 若要為事件中樞啟用診斷記錄,請在 Azure 入口網站中 [事件中樞] 頁面左側功能表上選取 [診斷設定]。To enable diagnostic logging for an event hub, select Diagnostic settings on the left menu on the Event Hub page in the Azure portal. 如需詳細資訊,請參閱 Azure 事件中樞設定診斷記錄For more information, see Set up diagnostic logs for an Azure event hub.

使用 Azure Resource Manager 範本啟用自動擴充Enable Auto-Inflate using an Azure Resource Manager template

您可以在 Azure Resource Manager 範本部署期間啟用自動擴充。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. 例如:For example:

"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: