title: Java TCP/IP Socket write performance optimization
body: <p><strong>Server Environment</strong></p>
  
  <pre><code>Linux/RedHat
  6 cores
  Java 7/8
  </code></pre>
  
  <p><strong>About application :</strong></p>
  
  <p>We are working on developing a low latency (7-8 ms) high speed trading platform using Java. Multi-leg orders are sent after algo conditions are met</p>
  
  <p><strong>Problem</strong></p>
  
  <p>The orders to the exchange using TCP/IP <code>java.net.Socket</code> APIs (using <code>java.io.OutputStream.write(bytes[] arg0)</code> ). Profiler measurement is records as 5-7 microsec which is very high as per our low latency reqs. We are not made use of setPerformancePreferences() api as suggested in one of the questions posted in stacktrace.</p>
  
  <p><strong>Question</strong></p>
  
  <ol>
  <li>Any alternatives to java.net.Socket to reduce the socket
  transmission time?</li>
  <li>Any optimization techniques to improve performance</li>
  <li>Is setPerformancePreferences() is of any use?</li>
  </ol>