• Post Reply Bookmark Topic Watch Topic
  • New Topic

TCP tuning on linux with java

 
Elhanan Maayan
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
we have a java socket application which accepts short burst of messages from another java application across the network

we've noticed that even though we have a minimal use of java accept and fork to a new thread, we still drop packets, which can be seen with netstat -s in the parameter 'times the listen queue of a socket overflowed'

the only we could manage to stop the drop is by increasing the maxSoConn with sysCtl and increasing the baclog parameter in serverSocket, is there any other way in turning java itself or linux machine other then just increasing the backlog?
 
Henry Wong
author
Sheriff
Posts: 22516
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Elhanan Maayan wrote:
the only we could manage to stop the drop is by increasing the maxSoConn with sysCtl and increasing the baclog parameter in serverSocket, is there any other way in turning java itself or linux machine other then just increasing the backlog?


Unfortunately, TCP as a protocol is not very tunable. The concept of allowing more connections and increasing the backlog are the only options for the rendezvous sockets -- and this is not specific to Java (or Linux).

Having said that, just how big a burst of connections are you looking at? ... because, if all you are doing is accept and pass the data socket to another thread as quick as possible, the defaults should be able to handle it.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!