Skip to content

Commit 1d673dc

Browse files
authored
Merge pull request #258815 from vhorne/fw-best-practices
add best practices
2 parents 459e733 + 887396a commit 1d673dc

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Azure Firewall best practices for performance
3+
description: Learn how to configure Azure Firewall to maximize performance
4+
services: firewall
5+
author: vhorne
6+
ms.service: firewall
7+
ms.topic: conceptual
8+
ms.date: 11/17/2023
9+
ms.author: victorh
10+
---
11+
12+
# Best practices for Azure Firewall performance
13+
14+
To maximize the [performance](firewall-performance.md) of your Azure Firewall and Firewall policy, it’s important to follow best practices. However, certain network behaviors or features can affect the firewall’s performance and latency, despite its performance optimization capabilities.
15+
16+
## Performance issues common causes
17+
18+
- **Exceeding rule limitations**
19+
20+
If you exceed limitations, such as using over 20,000 unique source/destination combinations in rules, it can affect firewall traffic processing and cause latency. Even though this is a soft limit, if you surpass this value it can affect overall firewall performance. For more information, see the [documented limits](../nat-gateway/tutorial-hub-spoke-nat-firewall.md).
21+
22+
- **High traffic throughput**
23+
24+
Azure Firewall Standard supports up to 30 Gbps, while Premium supports up to 100 Gbps. For more information, see the [throughput limitations](firewall-performance.md#performance-data). You can monitor your throughput or data processing in Azure Firewall metrics. For more information, see [Azure Firewall metrics](logs-and-metrics.md#metrics).
25+
26+
- **High Number of Connections**
27+
28+
An excessive number of connections passing through the firewall can lead to SNAT (Source Network Address Translation) port exhaustion.
29+
30+
- **IDPS Alert + Deny Mode**
31+
32+
If you enable IDPS Alert + Deny Mode, the firewall drops packets that match an IDPS signature. This affects performance.
33+
34+
## Recommendations
35+
36+
- **Optimize rule configuration and processing**
37+
38+
- Organize rules using firewall policy into Rule Collection Groups and Rule Collections, prioritizing them based on their use frequency.
39+
- Use [IP Groups](ip-groups.md) or IP prefixes to reduce the number of IP table rules.
40+
- Prioritize rules with the highest number of hits.
41+
- Ensure that you are within the following [rule limitations](../nat-gateway/tutorial-hub-spoke-nat-firewall.md).
42+
- **Use or migrate to Azure Firewall Premium**
43+
- Azure Firewall Premium uses advanced hardware and offers a higher-performing underlying engine.
44+
- Best for heavier workloads and higher traffic volumes.
45+
- It also includes built-in accelerated networking software, which can achieve throughput of up to 100 Gbps, unlike the Standard version.
46+
- **Add multiple public IP addresses to the firewall to prevent SNAT port exhaustion**
47+
- To prevent SNAT port exhaustion, consider adding multiple public IP addresses (PIPs) to your firewall. Azure Firewall provides [2,496 SNAT ports per each additional PIP](../nat-gateway/tutorial-hub-spoke-nat-firewall.md).
48+
- If you prefer not to add more PIPs, you can add an Azure NAT Gateway to scale SNAT port usage. This provides advanced SNAT port allocation capabilities.
49+
- **Start with IDPS Alert mode before you enable Alert + Deny mode**
50+
- While the *Alert + Deny* mode offers enhanced security by blocking suspicious traffic, it can also introduce more processing overhead. If you disable this mode, you might observe performance improvement, especially in scenarios where the firewall is primarily used for routing and not deep packet inspection.
51+
- It's essential to remember that traffic through the firewall is denied by default until you explicitly configure *allow* rules. Therefore, even when IDPS *Alert + Deny* mode is disabled, your network remains protected, and only explicitly permitted traffic is allowed to pass through the firewall. It can be a strategic choice to disable this mode to optimize performance without compromising the core security features provided by the Azure Firewall.
52+
53+
## Testing and monitoring
54+
55+
To ensure optimal performance for your Azure Firewall, you should continuously and proactively monitor it. It's crucial to regularly assess the health and key metrics of your firewall to identify potential issues and maintain efficient operation, especially during configuration changes.
56+
57+
Use the following best practices for testing and monitoring:
58+
59+
- **Test latency introduced by the firewall**
60+
- To assess the latency added by the firewall, measure the latency of your traffic from the source to the destination by temporarily bypassing the firewall. To do this, reconfigure your routes to bypass the firewall. Compare the latency measurements with and without the firewall to understand its effect on traffic.
61+
- **Measure firewall latency using latency probe metrics**
62+
- Use the *latency probe* metric to measure the average latency of the Azure Firewall. This metric provides an indirect metric of the firewall’s performance. Remember that intermittent latency spikes are normal.
63+
- **Measure traffic throughput metric**
64+
- Monitor the *traffic throughput* metric to understand how much data passes through the firewall. This helps you gauge the firewall’s capacity and its ability to handle the network traffic.
65+
- **Measure data processed**
66+
- Keep track of the *data processed* metric to assess the volume of data processed by the firewall.
67+
- **Identify rule hits and performance spikes**
68+
- Look for spikes in network performance or latency. Correlate rule hit timestamps, such as application rules hit count and network rules hit count, to determine if rule processing is a significant factor contributing to performance or latency issues. By analyzing these patterns, you can identify specific rules or configurations that you might need to optimize.
69+
- **Add alerts to key metrics**
70+
- In addition to regular monitoring, it's crucial to set up alerts for key firewall metrics. This ensures that you're promptly notified when specific metrics surpass predefined thresholds. To configure alerts, see [Azure Firewall logs and metrics](logs-and-metrics.md#alert-on-azure-firewall-metrics) for detailed instructions about setting up effective alerting mechanisms. Proactive alerting enhances your ability to respond swiftly to potential issues and maintain optimal firewall performance.
71+
72+
## Next steps
73+
74+
- [Azure Firewall performance](firewall-performance.md)

articles/firewall/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ items:
131131
href: firewall-multi-hub-spoke.md
132132
- name: Azure Firewall with Microsoft Sentinel
133133
href: firewall-sentinel-overview.md
134+
- name: Best practices for performance
135+
href: firewall-best-practices.md
134136
- name: How-to guides
135137
items:
136138
- name: Deploy

0 commit comments

Comments
 (0)