IIS 7 and Above
Error: "system lacked sufficient buffer space" / IIS 7.5
Last post Nov 12, 2018 08:45 AM by csiis
Nov 07, 2018 01:25 PM|csiis|LINK
We have a Windows 2008 R2 server running IIS 7.5. IIS has 2 separate sites; 1 which is the main website which is accessible from the Internet (which we'll call WEB1) and the 2nd which acts as a CDN, hosting images, CSS etc. which we'll call (WEB2)
WEB1 needs to call CSS from WEB2. Both sites reside on the same IIS server but are configured to run from different IP addresses. We use a local hosts file entry to facilitate WEB1's connection to WEB2. Every so often, WEB1 website falls over, with the following
being written as an error in event viewer:
System.Exception: Failed to retrieve content from CDN, looking for /css/xx.css with error System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed
because the system lacked sufficient buffer space or because a queue was full WEB2:80
Does anyone have any ideas how we can resolve this, because it results in a complete website outage.
Many thanks in advance!
Nov 08, 2018 08:23 AM|Brando Zhang|LINK
According to your description, I guess your server may open a lot of prots when the web1 accsss web2. So it will show this error.
I suggest you could firstly run below command to see how many port has opened now to find out the reason.
Nov 08, 2018 03:36 PM|csiis|LINK
Thanks Brando, is there something that i can implement to fix this?
Nov 12, 2018 02:25 AM|Brando Zhang|LINK
In my opinion, we should firstly find out the reason why your application will take so many ports as TCP connection ports.
As far as I know, each connection will have a time delay.
If the application has already get the file, it will close the connection.
I suggest you could try to use web browser to access the application and then use F12 develop tool's netwrork tag to see how many connection has sent to the server.
If you still couldn't find out the reason.
I suggest you could try to reduce the TcpTimedWaitDelay parameter in your server.
The TcpTimedWaitDelay parameter:
Determines the time that must elapse before TCP can release a closed connection and reuse its resources. This interval between closure and release is known as the TIME_WAIT state or 2MSL state. During this time, the connection can
be reopened at much less cost to the client and server than establishing a new connection.
Reducing the value of this entry allows TCP to release closed connections faster, providing more resources for new connections. However, if the value is too low, TCP might release connection resources before the connection is complete,
requiring the server to use additional resources to reestablish the connection.
TcpTimedWaitDelay can be modified by regedit at HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters. It contains the number of seconds to wait. The default is 240 seconds (4 minutes). Reboot is required if changed.
Nov 12, 2018 08:45 AM|csiis|LINK
Thanks Brando, very useful. I'll go ahead and establish how many ports our application opens and why.
We made the following change, which appears to have stopped the issue from reoccurring -