Southbound-Traffic zwischen Apigee und einem Ziel-Backend mit einer öffentlichen IP-Adresse verwendet Cloud NAT, um die private IP-Adresse Ihrer Apigee-Instanz in eine öffentliche IP-Adresse zu übersetzen. Wenn Ihr Ziel-Backend eine IP-Zulassungsliste erfordert, können Sie statische NAT-IP-Adressen für ausgehenden Traffic reservieren und aktivieren.
In diesem Thema wird beschrieben, wie Sie die Mindestanzahl der statischen NAT-IP-Adressen berechnen, die für den erwarteten Traffic erforderlich sind.
Hinweise
Wenn Sie die statische NAT-IP-Adresszuweisung zur Unterstützung der Zulassungsliste verwenden möchten, müssen Sie die Mindestanzahl der statischen IP-Adressen berechnen, die für den erwarteten Traffic erforderlich sind. Für diese Berechnung benötigen Sie die folgenden Informationen:
Maximale Zeit pro Transaktion: Dies ist die maximale Zeit in Sekunden, die eine Transaktion vom Beginn der Anfrage bis zum Ende der Antwort dauert.
Maximale Transaktionen pro Sekunde (TPS): Dies ist die maximale Anzahl von Transaktionen pro Sekunde, die von der Apigee-Instanz unterstützt werden.
Maximale TPS für ein einzelnes eindeutiges Backend: Dies ist die maximale Anzahl von Transaktionen pro Sekunde, die von einem einzelnen Backend unterstützt werden können.
Maximale Anzahl von Umgebungen: Die maximale Anzahl von Umgebungen in dieser Apigee-Instanz.
Anzahl der erforderlichen statischen IP-Adressen berechnen
Mit den folgenden Formeln können Sie die Mindestanzahl der NAT-IP-Adressen berechnen, die statisch zugewiesen werden müssen:
Maximale Anzahl an erforderlichen NAT-Quellports pro Backend als $ S $ berechnen.
$$ S = \lceil (150 + T) \times B \rceil $$
Wobei:
$ T $ ist die maximale Zeit pro Transaktion in Sekunden.
$ B $ ist der maximale TPS-Wert für ein einzelnes eindeutiges Backend.
$ \lceil \rceil $ ist die Ceiling-Funktion (kleinste Ganzzahl), also das Aufrunden auf die nächste Ganzzahl
Mindestanzahl der von der Apigee-Instanz verwendeten Ports als $ N $ berechnen.
$$ N = max(4096 \times E, \lceil {512 \over 75} \times R \rceil) + 6144 $$
Wobei:
$ E $ ist die Anzahl der Apigee-Umgebungen.
$ R $ ist der maximale TPS-Wert für die Apigee-Instanz.
$ \lceil \rceil $ ist die Ceiling-Funktion (kleinste Ganzzahl), also das Aufrunden auf die nächste Ganzzahl
Die Funktion $ \mathit{max}() $ verwendet das Maximum der beiden Werte.
Maximale Anzahl an erforderlichen Ports als $ P $ berechnen.
$$ P = max(S, N) $$
Wobei:
$ S $ ist die maximale Anzahl der erforderlichen NAT-Quellports, wie in Schritt 1 berechnet.
$ N $ ist die Mindestanzahl der Ports, die von der Apigee-Instanz verwendet wird, wie in Schritt 2 berechnet.
Die Funktion $ \mathit{max}() $ verwendet das Maximum der beiden Werte.
Mindestanzahl der erforderlichen NAT-IP-Adressen als $ I $ berechnen.
$$ I = \lceil P / 64512 \rceil $$
Wobei:
$ P $ ist die maximale Anzahl an erforderlichen Ports, wie in Schritt 3 berechnet.
$ \lceil \rceil $ ist die Ceiling-Funktion (kleinste Ganzzahl), also das Aufrunden auf die nächste Ganzzahl
Beispiele
Beispiel 1
In diesem Beispiel erwarten wir maximal 10.000 TPS in einer Umgebung. Die Transaktionen sind alle HTTP GET-Anfragen und die Transaktionsdauer des 99. Perzentils beträgt 50 Millisekunden (ms). Diese Anfragen werden ungleichmäßig von einem Pool von Servern hinter drei Load Balancer-Back-Ends verarbeitet, wobei einer der Load Balancer 5.000 TPS, der andere 3.000 TPS und der letzte Load Balancer 2.000 TPS verwendet.
In diesem Beispiel sind die Schlüsselwerte folgende:
Maximale Zeit pro Transaktion: 50 ms
Maximale TPS für die Apigee-Instanz: 10.000
Maximale TPS für ein einzelnes Backend: 5.000
Anzahl der Apigee-Umgebungen: 1
Mit den zuvor beschriebenen Formeln können wir die Anzahl der erforderlichen NAT-IP-Adressen berechnen:
Die maximale Anzahl der NAT-Quellports, die pro Backend erforderlich sind, unter der Annahme, dass keine Verbindung wiederverwendet wird, beträgt 750.250.
Die Mindestanzahl der NAT-IP-Adressen, die erforderlich ist, um ein Maximum von 10.000 TPS zu je 50 ms (oder weniger) zu unterstützen, wobei eine einzelne Backend IP-Adresse und ein Portpaar ein Maximum von 5.000 TPS unterstützen, beträgt 12.
Beispiel 2
In diesem Beispiel erwarten wir maximal 1.000 TPS für 20 Apigee-Umgebungen. Die Dauer des 99. Perzentils dieser Transaktionen beträgt 5 Sekunden. Diese Anfragen werden von 8 Ziel-Back-Ends verarbeitet, wobei der Traffic normalerweise gleichmäßig auf alle verteilt wird. Unter Berücksichtigung von Wartungsarbeiten und Ausfällen sollte ein einzelnes Backend nie mehr als 250 TPS verarbeiten.
In diesem Beispiel sind die Schlüsselwerte folgende:
Maximale Zeit pro Transaktion: 5 s
Maximale Anzahl von Transaktionen pro Sekunde (TPS): 1.000
Maximale TPS für ein einzelnes Backend: 250
Anzahl der Apigee-Umgebungen: 20
Mit den zuvor beschriebenen Formeln können wir die Anzahl der erforderlichen NAT-IP-Adressen berechnen:
Die maximale Anzahl der NAT-Quellports, die pro Backend erforderlich sind, unter der Annahme, dass keine Verbindung wiederverwendet wird, beträgt 38.750.
Die erforderliche Mindestanzahl von NAT-IP-Adressen zur Unterstützung von maximal 1.000 TPS zu je 5 Sekunden (oder weniger) mit einer einzigen Backend-IP-Adresse und einem Port-Paar, das maximal 250 TPS unterstützt, beträgt 2.
Beispiel 3
In diesem Beispiel möchten wir den maximalen TPS-Wert berechnen, der über 2 NAT-IP-Adressen und ein einzelnes Ziel-Backend erreichbar ist. Die maximale Zeit pro Transaktion beträgt schätzungsweise 100 ms.
In diesem Beispiel sind die Schlüsselwerte folgende:
Maximale Zeit pro Transaktion: 100 ms
Anzahl der NAT-IP-Adressen: 2
In diesem Fall können wir mit den Formeln in Schritt 4 und Schritt 1 die maximale Anzahl der bereitgestellten NAT-Quellports und den TPS-Wert berechnen, der von den Quellports unterstützt werden kann:
$$ 2 = \lceil P / 64512 \rceil $$
$$ 129024 = P $$
Die maximale Anzahl der bereitgestellten NAT-Quellports beträgt 129.024.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThis document explains how to calculate the minimum number of static NAT IPs needed for Apigee to support outbound traffic to target backends that require IP allow-listing.\u003c/p\u003e\n"],["\u003cp\u003eThe calculation requires knowing the maximum time per transaction, maximum transactions per second (TPS) for both the Apigee instance and a single backend, and the number of Apigee environments.\u003c/p\u003e\n"],["\u003cp\u003eThe provided formulas determine the maximum number of NAT source ports required, which is then used to find the minimum number of NAT IPs needed, using a "worst-case" scenario that does not consider connection reuse.\u003c/p\u003e\n"],["\u003cp\u003eExamples are included to demonstrate how to apply these formulas in scenarios with different transaction rates, durations, and backend configurations to calculate required static NAT IPs.\u003c/p\u003e\n"],["\u003cp\u003eThe document is applicable to Apigee and not to Apigee hybrid.\u003c/p\u003e\n"]]],[],null,["# Calculating static NAT IP requirements\n\n*This page\napplies to **Apigee** , but not to **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nSouthbound traffic between Apigee and a target backend with a public IP address uses [Cloud NAT](https://cloud.google.com/nat/docs/overview)\nto translate the private IP address of your Apigee instance into a public IP address. If your target backend requires IP allow-listing, you can reserve and activate static NAT IPs for egress traffic.\nThis topic describes how to calculate the minimum number of static NAT IPs required to support anticipated traffic.\n\nBefore you begin\n----------------\n\nIf you choose to use static NAT IP allocation to support allow-listing, you will need to calculate\nthe minimum number of static IPs required to support anticipated traffic. For this calculation, you will need the following information:\n\n- **Maximum time per transaction**: This is the maximum time, in seconds, that a transaction will take, from the start of the request until the end of the response.\n- **Maximum transactions per second (TPS)**: This is the maximum number of transactions per second the Apigee instance can possibly support.\n- **Maximum TPS for a single unique backend**: This is the maximum number of transactions per second that any single backend can possibly support.\n- **Maximum number of environments**: The maximum number of environments on this Apigee instance.\n\n| **Note**: The maximums detailed above are a part of capacity planning for NAT, and must include consideration of possible traffic spikes, TPS increases for backends due to a maintenance or outage, and future environment additions. It is recommended to add some buffer to the projected numbers in order to handle unforeseen traffic increases, and to redo the NAT calculations when projections change.\n\nCalculate the number of static IPs required\n-------------------------------------------\n\nYou can use the following formulas to calculate the minimum number of NAT IPs that need to be statically assigned:\n\n1. Calculate the maximum number of NAT source ports required per backend as $ S $. \n $$ S = \\\\lceil (150 + T) \\\\times B \\\\rceil $$\n\n Where:\n - $ T $ is the maximum time per transaction, in seconds.\n - $ B $ is the maximum TPS for any single unique backend.\n - $ \\\\lceil \\\\rceil $ is the ceiling (least integer) function, meaning round up to the next integer\n2. Calculate the minimum ports used by the Apigee instance as $ N $. \n $$ N = max(4096 \\\\times E, \\\\lceil {512 \\\\over 75} \\\\times R \\\\rceil) + 6144 $$\n\n Where:\n - $ E $ is the number of Apigee environments.\n - $ R $ is the maximum TPS for the Apigee instance.\n - $ \\\\lceil \\\\rceil $ is the ceiling (least integer) function, meaning round up to the next integer\n - The $ \\\\mathit{max}() $ function takes the maximum of the two values.\n3. Take the maximum number of ports required as $ P $. \n $$ P = max(S, N) $$\n\n Where:\n - $ S $ is the maximum number of NAT source ports required, as calculated in Step 1.\n - $ N $ is the minimum number of ports used by the Apigee instance, as calculated in Step 2.\n - The $ \\\\mathit{max}() $ function takes the maximum of the two values.\n4. Calculate the minimum number of NAT IPs required as $ I $. \n $$ I = \\\\lceil P / 64512 \\\\rceil $$\n\n Where:\n - $ P $ is the maximum number of ports required, calculated in Step 3.\n - $ \\\\lceil \\\\rceil $ is the ceiling (least integer) function, meaning round up to the next integer\n\n| **Note** : These formulas do not account for connection reuse, and instead calculate a \"worst-case\" scenario where no connections are reused. Actual connection reuse may vary. See [Connection Reuse](/apigee/docs/api-platform/security/nat-performance#connection-reuse) for the factors that contribute to an Apigee instance reusing an existing connection or opening a new one.\n\nExamples\n--------\n\n### Example 1\n\nIn this example, we expect a maximum of 10,000 TPS across 1 environment. The transactions are all `HTTP GET` requests\nand the 99th percentile transaction duration is 50 milliseconds (ms). These requests are unevenly served by a pool of\nservers behind 3 load balancer backends, with one of the load balancers taking 5,000 TPS, another taking 3,000 TPS, and the last\nload balancer taking 2,000 TPS.\n\nFor this example, the key values are as follows:\n\n- Maximum time per transaction: **50 ms**\n- Maximum TPS for the Apigee instance: **10,000**\n- Maximum TPS for a single backend: **5,000**\n- Number of Apigee environments: **1**\n\nUsing the formulas outlined earlier, we can calculate the number of NAT IPs required:\n\n1. $$ \\\\lceil (150 + 0.050) \\\\times 5000 \\\\rceil = \\\\lceil 150.050 \\\\times 5000 \\\\rceil = \\\\lceil 750250 \\\\rceil = 750250 $$\n\n The maximum number of NAT source ports required per backend, assuming no connection reuse, is **750,250**.\n 2. $$ max(4096 \\\\times 1, \\\\lceil {512 \\\\over 75} \\\\times 10000 \\\\rceil) + 6144 $$ \n $$ max(4096, \\\\lceil 6.827 \\\\times 10000 \\\\rceil) + 6144 $$ \n $$ max(4096, \\\\lceil 68270 \\\\rceil) + 6144 $$ \n $$ 68270 + 6144 = 74414 $$\n\n The minimum number of NAT source ports used by the Apigee runtime is **74,414**.\n3. $$ max(750250, 74414) = 750250 $$\n\n The maximum number of NAT source ports required per instance is **750,250**.\n4. $$ \\\\lceil 750250 / 64512 \\\\rceil = \\\\lceil 11.630 \\\\rceil = 12 $$\n\n The minimum number of NAT IPs required to support a maximum of 10,000 TPS of 50 ms each (or\n less), with a single backend IP and port pair supporting a maximum of 5,000 TPS, is\n **12**.\n\n### Example 2\n\nIn this example, we expect a maximum of 1,000 TPS across 20 Apigee environments. The\n99th percentile duration of these transactions is 5 seconds. These requests will be served by 8\ntarget backends, with traffic normally evenly distributed across all of them. With consideration\nfor maintenance and outages, a single backend is never expected to serve more than 250 TPS.\n\nFor this example, the key values are as follows:\n\n- Maximum time per transaction: **5s**\n- Maximum transactions per second (TPS): **1,000**\n- Maximum TPS for a single backend: **250**\n- Number of Apigee environments: **20**\n\nUsing the formulas outlined earlier, we can calculate the number of NAT IPs required:\n\n1. $$ \\\\lceil (150 + 5) \\\\times 250 \\\\rceil = \\\\lceil 155 \\\\times 250 \\\\rceil = \\\\lceil 38750 \\\\rceil = 38750 $$\n\n The maximum number of NAT source ports required per backend, assuming no connection reuse, is **38,750**.\n 2. $$ max(4096 \\\\times 20, \\\\lceil {512 \\\\over 75} \\\\times 1000 \\\\rceil) + 6144 $$ \n $$ max(81920, \\\\lceil 6.827 \\\\times 1000 \\\\rceil) + 6144 $$ \n $$ max(81920, \\\\lceil 6827 \\\\rceil) + 6144 $$ \n $$ 81920 + 6144 = 88064 $$\n\n The minimum number of NAT source ports used by the Apigee runtime is **88,064**.\n3. $$ max(38750, 88064) = 88064 $$\n\n The maximum number of NAT source ports required per instance is **88,064**.\n4. $$ \\\\lceil 88064 / 64512 \\\\rceil= \\\\lceil 1.365 \\\\rceil= 2 $$\n\n The minimum number of NAT IPs required to support a maximum of 1,000 TPS of 5 seconds each (or less),\n with a single backend IP and port pair supporting a maximum of 250 TPS, is **2**.\n\n### Example 3\n\nIn this example, we want to calculate the maximum TPS achievable with 2 NAT IPs to a single\ntarget backend. The maximum time per transaction is estimated to be 100 ms.\n\nFor this example, the key values are as follows:\n\n- **Maximum time per transaction**: 100ms\n- **Number of NAT IPs**: 2\n\nIn this case, we can use the formulas in Step 4 and Step 1 to calculate the maximum number of\nNAT source ports provided and the number of TPS those source ports can support:\n\n 1. $$ 2 = \\\\lceil P / 64512 \\\\rceil $$ \n $$ 129024 = P $$\n\n The maximum number of NAT source ports provided is **129,024**.\n 2. $$ 129024 = \\\\lceil (150 + 0.100) \\\\times B \\\\rceil $$ \n $$ 129024 = \\\\lceil 150.1 \\\\times B \\\\rceil $$ \n $$ \\\\lfloor 129024 / 150.1 \\\\rfloor = B $$ \n $$ \\\\lfloor 859.587 \\\\rfloor = B $$ \n $$ 859 = B $$\n\n The max TPS is **859** with 2 NAT IPs to a single backend, assuming no connection reuse."]]