title: jersey client performance on entity reading
body: <p>I have a very smilar jersey client as below. If client and sever are at same machine </p>
  
  <blockquote>
    <p>response.getEntity(String.class)</p>
  </blockquote>
  
  <p>line takes only nanoseconds but if client and server are at different machines this takes 250-300 miliseconds. I tried this on both jersey 1 and jersey 2 but the result didn't changed. Do you have any idea?</p>
  
  <pre><code>package com.mkyong.client;
  
  import com.sun.jersey.api.client.Client;
  import com.sun.jersey.api.client.ClientResponse;
  import com.sun.jersey.api.client.WebResource;
  
  public class JerseyClientGet {
  
    public static void main(String[] args) {
      try {
  
          Client client = Client.create();
  
          WebResource webResource = client
             .resource("http://localhost:8080/RESTfulExample/rest/json/metallica/get");
  
          ClientResponse response = webResource.accept("application/json")
                     .get(ClientResponse.class);
  
          if (response.getStatus() != 200) {
             throw new RuntimeException("Failed : HTTP error code : "
              + response.getStatus());
          }
  
          String output = response.getEntity(String.class);
  
          System.out.println("Output from Server .... \n");
          System.out.println(output);
  
        } catch (Exception e) {
  
          e.printStackTrace();
  
        }
  
      }
  }
  </code></pre>