472,358 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,358 software developers and data experts.

sql server causes No buffer space available (maximum connections reached?): recv failed

I'll try and keep this brief so in a nutshell:

I have large distributed java system running on a Windows 2003 server
(4cpu 8Gb memory).

Periodically the following exceptions occurs in the servers:

java.net.SocketException: No buffer space available (maximum
connections reached?): recv failed

I know for a fact we are not using too many TCPIP sockets or running
too many socket servers.

I have googled this error and found very little to help me.

What buffer space is this?
What does recv failed mean?

(Is it at all relevant that sql server is running on the same box?)

Any advice appreciated.
Thanks in advance.

Dan

Jul 23 '05 #1
5 30055
(da**********@tamesis.com) writes:
I'll try and keep this brief so in a nutshell:

I have large distributed java system running on a Windows 2003 server
(4cpu 8Gb memory).

Periodically the following exceptions occurs in the servers:

java.net.SocketException: No buffer space available (maximum
connections reached?): recv failed

I know for a fact we are not using too many TCPIP sockets or running
too many socket servers.

I have googled this error and found very little to help me.

What buffer space is this?
What does recv failed mean?

(Is it at all relevant that sql server is running on the same box?)


At least I can answer the question what "recv failed". It means that a
call to recv failed. recv is one of the basic TCP/IP functions. Doing
"man recv" on a Unix box, I see

recv, recvfrom, recvmsg - receive a message from a socket

As for the buffer space, I assume that there is a shortage of
virtual memory somewhere. Maybe because you are not closing connection
correcly, or retrieving all data. Or you simply have a memory leak.
But I don't know Java, so I don't really have a clue in that part.

Whether the presence of SQL Server could matter, SQL Server by default
grabs as much memory it can, so it can as much in cache as possible. Then
again, it yields memory if another app competes for memory. You could
configure SQL Server to use less memory, but my gut feeling tells me
that you would still see this message, just less often.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
<da**********@tamesis.com> wrote:
I'll try and keep this brief so in a nutshell:

I have large distributed java system running on a Windows 2003 server
(4cpu 8Gb memory).

Periodically the following exceptions occurs in the servers:

java.net.SocketException: No buffer space available (maximum
connections reached?): recv failed

I know for a fact we are not using too many TCPIP sockets or running
too many socket servers.

I have googled this error and found very little to help me.

What buffer space is this?
What does recv failed mean?

(Is it at all relevant that sql server is running on the same box?)

Any advice appreciated.
Thanks in advance.

Dan
Dan,

Erland's already explained what recv is. The buffer the error message is
talking about refers to the TCP/IP stack's buffers. The error you're seeing
can be caused by multiple things: too much data queued up for send via
TCP/IP or you're out of ephemeral sockets. The big problem is that the
number of available ephmeral sockets doesn't change just because you have a
massive amount of RAM. I'm not a Winsock expert, but running out of
ephemeral sockets is common problem on Windows. Well, not that common, but
it's a fairly well known occurrence amoung the networking guru's (I'm *not*
one of those).
(Is it at all relevant that sql server is running on the same box?)
Maybe: it definitely won't help
I know for a fact we are not using too many TCPIP sockets or running
too many socket servers.


Are you sure? Because it's not just how many you have open simultaneously:
if you're rapidly opening and closing sockets you could cause the problem
you're seeing... there's a timeout period before the socket you closed is
returned to the available pool. Also, I haven't worked with Java's sockets
that much: if you don't explicitly close the socket, does it stick around
until a garbage collection cycle?

Download tcpview.exe from sysinternals.com: when the problem occurs, fire it
up and see what process has the greatest number of sockets out there. If
I'm correct, you'll probably see a bunch of sockets associated with one or a
few processes (and they'll probably be in the TIME_WAIT state...)
Here's some links that may help

A discussion of ephemeral ports

http://www.tcpipguide.com/free/t_TCP...Applicatio.htm

See this for some help on the Windows side (but be careful!)

http://support.microsoft.com/default...b;EN-US;196271

See this for someone with a similar problem...

http://forum.java.sun.com/thread.jsp...sageID=3177261
Craig

Jul 23 '05 #3
Thanks so much for the reply.

It is possible that sql server is the cause of the problem.

What I neglected to mention is that the system was running fine on the
machine whilst it had some VM software that partitioned the hardware
into 3 virtual boxes.

Once the VM software was removed the problem began.

Does this ring any more bells?

Can you suggest how best to set the memory limits on sql server.

Thanks again
Daniel

Jul 23 '05 #4
Just tried reduciing the max memory and problem still persists.

Getting desperate .....

Jul 23 '05 #5
(da**********@tamesis.com) writes:
Thanks so much for the reply.

It is possible that sql server is the cause of the problem.

What I neglected to mention is that the system was running fine on the
machine whilst it had some VM software that partitioned the hardware
into 3 virtual boxes.

Once the VM software was removed the problem began.

Does this ring any more bells?

Can you suggest how best to set the memory limits on sql server.


Enterprise Manager, Properties, the Memory tab. Here you can set min
and max memory SQL Server can use.

But I'm not surprised that if it does not help. The difference between
your current setup and your previous, is that communication to SQL
Server is really an intra-machine story, and this could affect TCP/IP.
But you don't really need TCP/IP in this. The preferred method for
communication in this case is shared memory, and unless you specify
a network library, this is what you will get in this case. Also, open
the Client Network Utility, and make sure that shared memory is available.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
3
by: Mochuelo | last post by:
Hi, I'm working with an asynchronous TCP server. I have a few questions that may seem silly, but I can't get to understand all this. Let's say that BeginAccept will cause the AcceptCallback...
0
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
26
by: Andrew Poelstra | last post by:
I hacked this together this morning so that I could shift my out-of- space code away from the rest of my logic. I wanted to allow array syntax on my dynamic buffers, so I manually created a struct...
4
by: SpreadTooThin | last post by:
client: import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("192.168.1.101", 8080)) print 'Connected' s.send('ABCD') buffer = s.recv(4) print buffer s.send('exit')
7
by: fniles | last post by:
I am using VB.Net 2003 and MS Access (connecting using OleDBConnection). I read using DataAdapter and DataSet, not DataReader. When many people try to access the database at the same time, I get...
0
by: sarahnetworking | last post by:
Hello, I have developed a client server application using C. i have a list of usernames and a list of passwords in a text file. i need to be able to do 2 loops so i can send the usernames and...
2
by: kodart | last post by:
Introduction Performance is the main concern to most server application developers. Thatís why many of them anticipate using .NET platform to develop high performance server application regardless...
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.