選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

使用多個網路卡最大化 Amazon EC2 執行個體的網路頻寬

焦點模式
使用多個網路卡最大化 Amazon EC2 執行個體的網路頻寬 - Amazon Elastic Compute Cloud

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

許多支援 EFA 的執行個體類型也具有多個網路卡。如需詳細資訊,請參閱網路卡。如果您計劃搭配其中一個執行個體類型使用 EFA,我們建議您使用下列基本組態:

  • 針對主要網路介面 (網路卡索引 0、裝置索引 0),建立 EFA (EFA 搭配 ENA) 介面。您不能使用僅限 EFA 的網路介面做為主要網路介面。

  • 對於每個額外的網路介面,根據您的使用案例,例如 ENA 頻寬需求或 IP 位址空間,使用下一個未使用的網路卡索引1、裝置索引 和 EFA (EFA 搭配 ENA) 或僅限 EFA 網路介面。如需使用案例範例,請參閱P5 執行個體的 EFA 組態

注意

P5 執行個體需要以特定方式設定網路介面,才能啟用最大網路頻寬。如需詳細資訊,請參閱P5 執行個體的 EFA 組態

下列範例示範如何根據這些建議啟動執行個體。

Instance launch
使用啟動執行個體精靈,在中啟動執行個體
  1. 網路設定區段中選擇編輯

  2. 展開 進階網路組態

  3. 針對主要網路介面 (網路介面 1),選取網路卡索引 = 0裝置索引 = 0,以及介面類型 = EFA 搭配 ENA

  4. 針對所需的每個額外網路介面,選擇新增網路介面。針對網路卡索引,選取下一個未使用的索引,然後選取裝置索引 = 1,且介面類型 = EFA 搭配 ENA 或僅限 EFA

使用 run-instances 命令在執行個體啟動期間指定 EFAs

針對 --network-interfaces,指定所需的網路介面數量。對於主要網路介面,針對 NetworkCardIndex=0 和 DeviceIndex=0 指定 InterfaceType=efa。對於任何其他網路介面, 會NetworkCardIndex指定下一個未使用的索引DeviceIndex=1、 和 InterfaceType=efaefa-only

下列範例命令程式碼片段顯示具有 32 個 EFA 網路介面的請求。

$ aws --region $REGION ec2 run-instances \ --instance-type p5.48xlarge \ --count 1 \ --key-name key_pair_name \ --image-id ami_id \ --network-interfaces "NetworkCardIndex=0,DeviceIndex=0,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=1,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=2,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=3,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=4,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=5,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=6,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=7,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=8,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=9,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=10,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=11,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=12,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=13,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=14,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=15,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=16,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=17,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=18,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=19,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=20,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=21,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=22,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=23,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=24,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=25,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=26,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=27,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=28,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=29,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=30,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=31,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" ...
Launch templates
使用 Amazon EC2 主控台將 EFAs 新增至啟動範本
  1. Network settings (網路設定) 下,展開 Advanced network configuration (進階網路組態)。

  2. 若要新增主要網路介面 (網路介面 1),請選擇新增網路介面,然後選擇網路卡索引 = 0裝置索引 = 0,以及介面類型 = EFA 搭配 ENA

  3. 選擇 Add network interface (新增網路介面) 以新增更多網路介面。針對網路卡索引,選取下一個未使用的索引,然後選取裝置索引 = 1,以及介面類型 = EFA 搭配 ENA 或僅限 EFA

使用 create-launch-template 命令將 EFAs 新增至啟動範本

針對 NetworkInterfaces,指定所需的網路介面數量。對於主要網路介面,針對 NetworkCardIndex=0 和 DeviceIndex=0 指定 InterfaceType=efa。對於任何其他網路介面, 會NetworkCardIndex指定下一個未使用的索引DeviceIndex=1、 和 InterfaceType=efaefa-only

下面的程式碼片段顯示了一個範例,其中包含可能的 32 個網路介面中的 3 個網路介面。

"NetworkInterfaces":[ { "NetworkCardIndex":0, "DeviceIndex":0, "InterfaceType": "efa", "AssociatePublicIpAddress":false, "Groups":[ "security_group_id" ], "DeleteOnTermination":true }, { "NetworkCardIndex": 1, "DeviceIndex": 1, "InterfaceType": "efa|efa-only", "AssociatePublicIpAddress":false, "Groups":[ "security_group_id" ], "DeleteOnTermination":true }, { "NetworkCardIndex": 2, "DeviceIndex": 1, "InterfaceType": "efa|efa-only", "AssociatePublicIpAddress":false, "Groups":[ "security_group_id" ], "DeleteOnTermination":true }, { "NetworkCardIndex": 3, "DeviceIndex": 1, "InterfaceType": "efa|efa-only", "AssociatePublicIpAddress":false, "Groups":[ "security_group_id" ], "DeleteOnTermination":true } ...
使用啟動執行個體精靈,在中啟動執行個體
  1. 網路設定區段中選擇編輯

  2. 展開 進階網路組態

  3. 針對主要網路介面 (網路介面 1),選取網路卡索引 = 0裝置索引 = 0,以及介面類型 = EFA 搭配 ENA

  4. 針對所需的每個額外網路介面,選擇新增網路介面。針對網路卡索引,選取下一個未使用的索引,然後選取裝置索引 = 1,且介面類型 = EFA 搭配 ENA 或僅限 EFA

使用 run-instances 命令在執行個體啟動期間指定 EFAs

針對 --network-interfaces,指定所需的網路介面數量。對於主要網路介面,針對 NetworkCardIndex=0 和 DeviceIndex=0 指定 InterfaceType=efa。對於任何其他網路介面, 會NetworkCardIndex指定下一個未使用的索引DeviceIndex=1、 和 InterfaceType=efaefa-only

下列範例命令程式碼片段顯示具有 32 個 EFA 網路介面的請求。

$ aws --region $REGION ec2 run-instances \ --instance-type p5.48xlarge \ --count 1 \ --key-name key_pair_name \ --image-id ami_id \ --network-interfaces "NetworkCardIndex=0,DeviceIndex=0,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=1,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=2,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=3,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=4,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=5,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=6,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=7,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=8,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=9,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=10,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=11,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=12,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=13,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=14,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=15,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=16,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=17,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=18,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=19,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=20,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=21,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=22,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=23,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=24,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=25,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=26,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=27,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=28,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=29,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=30,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" \ "NetworkCardIndex=31,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa|efa-only" ...

P5 執行個體的 EFA 組態

P5 執行個體的總網路頻寬容量為 3,200Gbps,其中最多 800Gbps 可用於 IP 網路流量。由於 EFA 和 IP 網路流量共用相同的基礎資源,因此一個使用的頻寬將減少另一個可用的頻寬。這表示只要總頻寬不超過 3,200 Gbps,且 IP 頻寬不超過 800 Gbps,您就可以在 EFA 流量和 IP 流量之間以任何組合分配網路頻寬。

使用案例 1:儲存 IP 位址並避免潛在的 Linux IP 問題

此組態提供高達 3,200 Gbps 的 EFA 網路頻寬,以及高達 100 Gbps 的 IP 網路頻寬,並具有一個私有 IP 位址。此組態也有助於避免潛在的 Linux IP 問題,例如不允許自動指派公有 IP 位址和 IP 路由挑戰 (主機名稱對 IP 位址映射問題和來源 IP 位址不相符),如果執行個體具有多個網路介面,則可能會發生這種情況。例如,如果您使用 400 Gbps 或 IP 頻寬,您可以同時達到高達 2,800 Gbps 的 EFA 頻寬。

  • 對於主要網路介面 (網路卡索引 0、裝置索引 0),請使用 EFA (EFA 搭配 ENA) 網路介面。

  • 對於剩餘的網路介面 (網路卡索引 1-31、裝置索引 1),請使用僅限 EFA 的網路介面。

使用案例 2:最大 EFA 和 IP 網路頻寬

此組態提供高達 3,200 Gbps 的 EFA 網路頻寬,以及高達 800 Gbps 的 IP 網路頻寬和 8 個私有 IP 位址。您無法使用此組態自動指派公有 IP 位址。但是,在啟動進行網際網路連線之後,可以將彈性 IP 位址連接至主要網路介面 (NetworkCardIndex=0、DeviceIndex=0)。

  • 對於主要網路介面 (網路卡索引 0、裝置索引 0),請使用 EFA (EFA 搭配 ENA) 網路介面。

  • 對於其餘的介面,請執行下列動作:

    • 在網路卡索引 1、2 和 3 上指定僅限 EFA 的網路介面,並使用裝置索引 1。

    • 在下列每個網路卡索引子集中指定一個 EFA (EFA 搭配 ENA) 網路介面和三個僅限 EFA 的網路介面,並使用裝置索引 1:

      • [4、5、6、7]

      • [8、9、10、11]

      • [12、13、14、15]

      • [16、17、18、19]

      • [20、21、22、23]

      • [24、25、26、27]

      • [28、29、30、31]

下圖說明了此設定。

$ aws --region $REGION ec2 run-instances \ --instance-type p5.48xlarge \ --count 1 \ --key-name key_pair_name \ --image-id ami_id \ --network-interfaces "NetworkCardIndex=0,DeviceIndex=0,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=1,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=2,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=3,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=4,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=5,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=6,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=7,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=8,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=9,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=10,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=11,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=12,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=13,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=14,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=15,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=16,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=17,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=18,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=19,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=20,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=21,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=22,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=23,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=24,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=25,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=26,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=27,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=28,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa" \ "NetworkCardIndex=29,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=30,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" \ "NetworkCardIndex=31,DeviceIndex=1,Groups=security_group_id,SubnetId=subnet_id,InterfaceType=efa-only" ...
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。