File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes hot to improve the socket performance ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "hot to improve the socket performance ?" Watch "hot to improve the socket performance ?" New topic
Author

hot to improve the socket performance ?

sachin kataria
Ranch Hand

Joined: Mar 27, 2006
Posts: 45
hot to improve the socket performance ?
i.e. allocation and deallocation of buffer
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Hi, welcome to the ranch!

It helps if you can make your questions more specific. What kind of performance problem are you running into? How do you know the problem is in the socket code?

If you're just concerned about "am I using sockets wisely" or "could I do something better" feel free to post some small, focused sections of code for comment. Use the "CODE" button below the editor to preserve code formatting.



A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
sachin kataria
Ranch Hand

Joined: Mar 27, 2006
Posts: 45
In my project , java handles the server....
so, there is so much load on server...
and i am getting error ....
" Maximum connection reach
No buffer space available ...."
so, what is reason?
pls help me....
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
A couple shots in the dark ... Have you tried tuning the "backlog" parameter on the ServerSocket constructor? I don't think you're getting a full queue error, but I'd have to force the error and see what the exception I get to be sure.

Take a look at the Apache Commons replacement for ServerSocket. It has tunable buffer size.

Other things I find on Google about this error appear to all be Linux. Are you on Linux? I know zip about that.
sachin kataria
Ranch Hand

Joined: Mar 27, 2006
Posts: 45
it is on windows platform..........
i increase the buffer size in registry, ie. MaxBufferSize in Tcp/ip/parameter
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Glad you found that.

Anyone, is there a general way for a server to throttle overwhelming connect requests? I made a server that accepts connection and passes the work of to a thread pool. If my task queue blocks when full I guess that would block me from accepting more connections. Then the requests would pile up in queue until it's full, and then the caller would get some kind of unavailable error?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hot to improve the socket performance ?