I noticed yesterday that there is a noticeable difference between the default network packet size in .NET's SqlConnection
class and the default in SQL Server itself.
For the SqlConnection
class' PacketSize
property, per this link:
The size (in bytes) of network packets. The default value is 8000.
In previous versions of that article, it mentions (all the way back to .NET 1.1) that the default was 8192 bytes. For SQL Server, however (per this link):
The default packet size is 4,096 bytes.
From that article it appears that that's been the default since at least SQL Server 2005. Does anyone know the reason for this difference between them?
UPDATE: To add more fun to this question, I've been talking to Thomas LaRock (who happens to be a SQL MVP), and he mentioned to me that in SQL Server 2000 the default network packet size was, in fact, 8192 bytes (like .NET 1.1!). It got changed in later versions, though, because of how much fragmentation it was causing, necessitating weekly reboots of the server.
So why did SQL Server reduce it by half, but .NET only reduced it by 192 bytes? Is there something forcing SQL Server to use only multiples of 2 for this?