Does the Windows firewall slow down SQL Server connectivity?

Discussions on whether to enable or to not enable the Windows firewall on internal SQL Severs can get quite heated.
This may require further testing, but initial testing shows that there is very little difference between having the Windows firewall enabled or not.
In a real simple test, a connection was attempted 30 times to a remote SQL Server with the Windows firewall enabled and another 30 times with the Windows firewall disabled.
The test consisted of a batch file recording the start/end times of the following command:

sqlcmd -S instancename -E -Q "SELECT @@SERVERNAME;"

Variations are expected due to SQL Server workloads, but never the less the times averaged out. Having the Windows firewall enabled was slightly faster with an average of 39.7 milliseconds compared to 40.8 milliseconds, which I was not expecting.
Below shows the milliseconds taken between the start/end of each test with the Windows firewall on and off:

Leave a Reply