<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Protocols : socket</title><link>http://blogs.msdn.com/sql_protocols/archive/tags/socket/default.aspx</link><description>Tags: socket</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Understanding the error “An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.”</title><link>http://blogs.msdn.com/sql_protocols/archive/2009/03/09/understanding-the-error-an-operation-on-a-socket-could-not-be-performed-because-the-system-lacked-sufficient-buffer-space-or-because-a-queue-was-full.aspx</link><pubDate>Mon, 09 Mar 2009 20:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9467982</guid><dc:creator>SQL Protocols</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/sql_protocols/comments/9467982.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sql_protocols/commentrss.aspx?PostID=9467982</wfw:commentRss><description>&lt;P style="TEXT-ALIGN: justify; MARGIN: 0in 0.85pt 0pt 0in" class=MsoNormal&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;This error message, which is associated with the Winsock error WSAENOBUFS and actually comes from Windows rather than SQL Server directly, has two well-understood root causes.&amp;nbsp;However, it still stumps people today, probably because&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;there is no single source which explains both root causes and offers solutions for both. Here is a description of the two common situations where you may see this error and quick solutions for each:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;OS runs out of memory for TCP buffers&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0in 0.85pt 0pt 0in" class=MsoNormal&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;When a powerful client machine, especially one with lots of RAM, is running an x86 version of Windows, people use the &lt;B style="mso-bidi-font-weight: normal"&gt;/PAE&lt;/B&gt; switch in the &lt;B style="mso-bidi-font-weight: normal"&gt;c:\boot.ini&lt;/B&gt; file to allow applications on that machine to be able to address the full range of memory. One other switch often used to give more memory to applications is the &lt;B style="mso-bidi-font-weight: normal"&gt;/3gb&lt;/B&gt; switch in the boot.ini file. The problem comes when these two are combined: the &lt;B style="mso-bidi-font-weight: normal"&gt;/3gb&lt;/B&gt; switch gives more memory to applications by reducing the amount of memory available to the OS. When it is used on a powerful machine where the applications require many OS resources, such as by opening many TCP connections, this can cause the OS to run out of memory for resources like TCP buffers. When that happens, Winsock throws the error WSAENOBUFS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0in 0.85pt 0pt 0.5in; mso-add-space: auto" class=MsoListParagraph&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Solution: &lt;B style="mso-bidi-font-weight: normal"&gt;Remove the /3gb switch from c:\boot.ini.&lt;/B&gt; The root problem in this case is memory pressure on the OS, so removing the /3gb switch will give more memory to the OS and will alleviate this problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;OS runs out of available TCP “ephemeral” ports&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0in 0.85pt 0pt 0in" class=MsoNormal&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;When the client machine is opening many TCP connections and is running Windows Server 2003, Windows XP, or any earlier version of Windows, it may run out of TCP “ephemeral” ports. In Windows Server 2003, Windows XP, and earlier versions, Windows limits the number of available ephemeral ports to approximately 5000 across the machine. It is especially common to hit this problem for applications which do not use connection pooling. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0in 0.85pt 0pt 0.5in; mso-add-space: auto" class=MsoListParagraph&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Solution: To make more ephemeral ports available, follow the directions in this KB which describe how to create the MaxUserPort&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;registry key: &lt;/FONT&gt;&lt;FONT size=3&gt;&lt;STRONG&gt;&lt;A href="http://support.microsoft.com/kb/196271"&gt;http://support.microsoft.com/kb/196271&lt;/A&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0in 0.85pt 0pt 0in" class=MsoNormal&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0in 0.85pt 0pt 0in" class=MsoNormal&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;o:p&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT color=#0000ff face=Calibri&gt;Dan Benediktson&lt;BR&gt;SQL Server Protocols&lt;BR&gt;&lt;/FONT&gt;&lt;SPAN style="mso-ansi-language: EN" lang=EN&gt;&lt;FONT color=#800080 face=Tahoma&gt;Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9467982" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sql_protocols/archive/tags/10055/default.aspx">10055</category><category domain="http://blogs.msdn.com/sql_protocols/archive/tags/socket/default.aspx">socket</category><category domain="http://blogs.msdn.com/sql_protocols/archive/tags/Winsock/default.aspx">Winsock</category><category domain="http://blogs.msdn.com/sql_protocols/archive/tags/WSAENOBUFS/default.aspx">WSAENOBUFS</category></item></channel></rss>