Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are trying to improve the average latency of Java proxy application.
The Java application receives a message from a client and proxies it to a necessary server.
The protocol is binary, asynchronous.

The topology is:

Client (1) - Java proxy (2) - Server (3)

Call flow is


The requirement is 2 ms average latency overhead for one direction hop for Java proxy.

We've noticed that if we increase the number of clients, latency overhead is decreased linearly.
Let's say,

1 client -> Java proxy latency overhead = 6 ms.
2 clients -> Java proxy latency overhead = 3 ms.
4 clients -> Java proxy latency overhead = 1.5 ms.

On the other hand we must comply with latency requirement even with one client.

The same behavior we observer, if we replace Java implementation of proxy with Erlang implementation.

Can we do anything for low level OS tuning?
Java proxy host is 2 Nehalem CPU X5550 2.67GHz, 16 hw threads in total; Red Hat Enterprise Linux Server release 5.6

share|improve this question

migrated from Oct 3 '11 at 11:47

This question came from our site for professional and enthusiast programmers.

What figures were you getting for the Erlang implementation of the proxy? – rvirding Oct 3 '11 at 18:05

Before you perform your testing, I would make sure the JVM is warmed up and set to a real time priority. You should be able to achieve a latency below 0.1 ms over and above the network latency.

share|improve this answer

Is your Java proxy blocking while it waits for the Server's response? That would explain the times you are seeing.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.