Webservice client high latency, faster through ssh tunnel

391 views Asked by At

I have developed a java webservice application with Apache CXF but I'm suffering a high latency for WS when I call them through the network. Basically this are the execution times:

  • Local (127.0.0.1/local address) call: 4ms
  • Local area network call: 200ms

However if I create a SSH connection to another machine a build a local tunnel using that connection:

remote_ip:110000->local:11000

And then I connected the client to local:11000 it takes only 40ms... any ideas?

Thanks in advance

UPDATE

I have a trace in the ws method call it is actually a Java proxy around the call. With that trace I'm getting the 4ms/200ms/40ms times.

Originally we thought that it may be a network problem but we tried the same call having all the machines connected to a single switch with the same results. When creating a tunnel we are using Putty (no special options)

1

There are 1 answers

2
light_303 On

Does your local network use a transparent proxy for filtering traffic? Under inbiased network conditions i would expect SSH tunelling to actually increase latency instead of decreasing it.

Also how do you measure latency? maybe you are using SSH compression and measuring the transfer time of your api response?

update: if you get the same slow results when having the client and server on the same switch it sounds like something odd with the network layer on these hosts. So e.g. having a packet inspecting firewall/virus scanner which intercepts all TCP traffic. This would of course not trigger when tunneling through SSH, since now this connection would appear to be localhost:localhost on the client machine.