• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

hot to improve the socket performance ?

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hot to improve the socket performance ?
i.e. allocation and deallocation of buffer
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
sachin kataria
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is on windows platform..........
i increase the buffer size in registry, ie. MaxBufferSize in Tcp/ip/parameter
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
The knights of nee want a shrubbery. And a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic