Hi Steen,
we have seen the same problem sometimes. We believe its more related
to the URLConnection
not being able to connect quick enough to your Tomcat because the
calls are so fast. So since
now the problem does not occur when you are no longer using the
loopback device (localhost)
but a REAL tcp/ip stack and the problem goes away I believe that shows
that it is in a strange
way TCP related.
We were running similar tests but with multiple threads and we were
getting rejected connections
(because the worker threads were exhausted) or bind address exceptions.
I can keep you posted if we find a better explanation.
regards
christian campo
On Tue, 07 Dec 2004 11:46:43 +0100, Steen Jansdal <steen@xxx.dk> wrote:
> Christian Campo wrote:
>
>
>
> > I have doubts that this is a good solution. (even thought it works in
> > your case). Since Hessian supports HTTP 1.1. it has good reason to
> > leave a connection open so that it can reuse it, if you do the next
> > call to the same webservice.
> > We found that Hessian can do quit a number of subsequent calls on the
> > same connection and I sure this improves the speed a lot.
> >
> > May you can tell what your test looks like. Are you getting a service
> > proxy for each webservice call or are you reusing old proxy objects.
> > ???
> >
> > Because of this we went as far as building a little cache of service
> > proxy objects so that our application can reuse the embedded
> > connection.
> >
> > regards
> > christian campo
> >
> >
>
> You are probably right that this is not a good solution. I'm not
> an expert in hessian. I'm only evaluating if hessian can be used
> in one of my projects.
>
> I just tried to run the client on another computer without problems,
> so it could be a problem when the server and the client are on the same box.
>
> My test is here:
>
> Basic.java:
> package dk.jansdal.hessian;
> public interface Basic {
> public String hello();
> }
>
> BasicImpl.java:
> package dk.jansdal.hessian;
> public class BasicImpl implements Basic {
> public String hello () {
> return "hello world";
> }
> }
>
> Client.java:
> package dk.jansdal.hessian;
> import com.caucho.hessian.client.HessianProxyFactory;
> public class Client {
> public static void main(String[] args) throws Exception
> {
> String url = "http://127.0.0.1:10001/basic";
> HessianProxyFactory factory = new HessianProxyFactory();
> Basic basic = (Basic) factory.create ( Basic.class, url );
> long start = System.currentTimeMillis();
> for ( int i = 0; i < 100000; i++ ) {
> String s = basic.hello();
> }
> long stop = System.currentTimeMillis();
> System.out.println ( "Time: " + (stop-start) );
> }
> }
>
> My box is a 1.9GHz Athlon running W2K and JDK 1.4.2_05
>
> regards
> Steen
>
>
-- christian campo (gmail.com)Received on Tue 07 Dec 2004 14:12:15 -0800
This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:40 PDT