You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Josef Bajada <jo...@gmail.com> on 2006/02/17 18:50:42 UTC

XmlRpc.execute() sometimes takes long

Hi,

I have the situation where my application is acting as the xml-rpc server
and I am implementing the XmlRpcHandler. Then, the handler is added to the
XmlRpcServer in this way.

xmlrpc = new XmlRpcServer();
xmlrpc.addHandler("$default", this);

As an http server I am using the Jetty web server.

What I am observing is that while in most situations the time between when
Jetty notifies me of a new connection till when my XmlRpcHandler.execute(String
method, Vector params)  only a handful of milliseconds pass, sometimes this
is prolonged to 3 seconds.

I am running this on a dedicated linux server 99% idle, so I am ruling
system resources out for the moment, even because this is either a few
milliseconds or 3.x seconds, never somewhere in between.

I am suspecting that the XmlRpcServer.execute() method is sometimes, for
some reason, taking too long to execute my method.

Any idea what part of the XmlRpcServer.execute() could take long? From a
quick look I gave it there doesnt seem to be anything that should take too
much time. Maybe the way the worker pool stack is working?

thanks and regards,

Josef

Re: XmlRpc.execute() sometimes takes long

Posted by Josef Bajada <jo...@gmail.com>.
Hi all,

This is not the case of a big document, only around 1Kb.

Well I dont exclude a network problem, since I assume that if data does not
come through, the parser obviously cannot return from the call. Thanks for
illuminating me with that. I will do some more investigation.

best regards,

Josef




On 2/20/06, John Wilson <tu...@wilson.co.uk> wrote:
>
>
> On 20 Feb 2006, at 12:51, Jochen Wiedmann wrote:
>
> >
> >> Seems like the call to parser.parse( ) at XmlRpc.java method parse
> >> ( ) is the
> >> culprit. There seem to be some occasions where this is taking 3
> >> seconds.
> >
> > Assuming that your document isn't overly large, this is extraordinary.
> >
> > How does the document look like? (Use a program like tcpmon, if you
> > are unsure.) Does it contain a document type declaration, an external
> > entity reference, or something similar? That's the only idea, I would
> > have. (And, clearly, this can only occur, if the client is *not* an
> > Apache XML-RPC client.)
>
>
> If he's using MinML then things like external DTD subsets will not
> make any difference to the speed of the parse.
>
> Measuring the time to parse is also measuring the time to read the
> document. I would guess we are seeing some sort of network problem here.
>
> This also measures the time to execute the SAX callbacks. However we
> don't do anything very complex in the callback. It's just possible
> that a very big Base64 decode could be taking a long time but I'd be
> very surprised if this was the case.
>
> If it's really a MinML problem I'd be delighted to see the document
> which causes the problem - It's been three or four years since I've
> had a bug reported;)
>
>
> John Wilson
> The Wilson Partnership
> http://www.wilson.co.uk
>
>
>

Re: XmlRpc.execute() sometimes takes long

Posted by Jochen Wiedmann <jo...@gmail.com>.
John Wilson wrote:

> Measuring the time to parse is also measuring the time to read the
> document. I would guess we are seeing some sort of network problem here.

Quite true. In which case ethereal or tcpdump might prove that there is
such a problem.


Jochen


Re: XmlRpc.execute() sometimes takes long

Posted by John Wilson <tu...@wilson.co.uk>.
On 20 Feb 2006, at 12:51, Jochen Wiedmann wrote:

>
>> Seems like the call to parser.parse( ) at XmlRpc.java method parse 
>> ( ) is the
>> culprit. There seem to be some occasions where this is taking 3  
>> seconds.
>
> Assuming that your document isn't overly large, this is extraordinary.
>
> How does the document look like? (Use a program like tcpmon, if you
> are unsure.) Does it contain a document type declaration, an external
> entity reference, or something similar? That's the only idea, I would
> have. (And, clearly, this can only occur, if the client is *not* an
> Apache XML-RPC client.)


If he's using MinML then things like external DTD subsets will not  
make any difference to the speed of the parse.

Measuring the time to parse is also measuring the time to read the  
document. I would guess we are seeing some sort of network problem here.

This also measures the time to execute the SAX callbacks. However we  
don't do anything very complex in the callback. It's just possible  
that a very big Base64 decode could be taking a long time but I'd be  
very surprised if this was the case.

If it's really a MinML problem I'd be delighted to see the document  
which causes the problem - It's been three or four years since I've  
had a bug reported;)


John Wilson
The Wilson Partnership
http://www.wilson.co.uk



Re: XmlRpc.execute() sometimes takes long

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 2/20/06, Josef Bajada <jo...@gmail.com> wrote:

> Seems like the call to parser.parse( ) at XmlRpc.java method parse( ) is the
> culprit. There seem to be some occasions where this is taking 3 seconds.

Assuming that your document isn't overly large, this is extraordinary.

How does the document look like? (Use a program like tcpmon, if you
are unsure.) Does it contain a document type declaration, an external
entity reference, or something similar? That's the only idea, I would
have. (And, clearly, this can only occur, if the client is *not* an 
Apache XML-RPC client.)

Jochen

--
Whenever you find yourself on the side of the
majority, it is time to pause and reflect.
(Mark Twain)

Re: XmlRpc.execute() sometimes takes long

Posted by Josef Bajada <jo...@gmail.com>.
Hi again everyone,

Seems like the call to parser.parse( ) at XmlRpc.java method parse( ) is the
culprit. There seem to be some occasions where this is taking 3 seconds.

I changed the XML parser through the sax.driver property (I am trying out
Piccolo at the moment since it claims interesting benchmarks) and am doing
some tests. I will let you know if I manage to isolate the problem.

best regards,

Josef


On 2/18/06, Josef Bajada <jo...@gmail.com> wrote:
>
> Hi Jochen,
>
> I am just asking if any of the developers know anything about this! I will
> put some logging into the source and see which activity is taking so long.
>
> Unfortunately at the moment these are the only facts I have. I'll let you
> know if I find anything new.
>
> Josef
>
> On 2/17/06, Jochen Wiedmann <jo...@gmail.com> wrote:
> >
> > Josef Bajada wrote:
> >
> > > I am suspecting that the XmlRpcServer.execute() method is sometimes,
> > for
> > > some reason, taking too long to execute my method.
> > >
> > > Any idea what part of the XmlRpcServer.execute() could take long? From
> > a
> > > quick look I gave it there doesnt seem to be anything that should take
> > too
> > > much time. Maybe the way the worker pool stack is working?
> >
> > You give us no hard facts, just questions. Knowing our code, I see no
> > reason believe in problems like that you are describing. I may be wrong,
> > but I would like to see facts, before banging my head.
> >
> > If you believe the worker pool stack to be faulty, replace it with a
> > worker factory, that creates new workers all the time.
> >
> >
> > Jochen
> >
>
>

Re: XmlRpc.execute() sometimes takes long

Posted by Jimisola Laursen <li...@jimisola.com>.
I haven't followed this thread fully, but if this is a plain Java project then I 
recommend using TPTP (www.eclipse.org) for profiling.

Regards,
Jimisola

----- Original Message ----- 
From: "Josef Bajada" <jo...@gmail.com>
To: <xm...@ws.apache.org>
Sent: Saturday, February 18, 2006 4:09 AM
Subject: Re: XmlRpc.execute() sometimes takes long


Hi Jochen,

I am just asking if any of the developers know anything about this! I will
put some logging into the source and see which activity is taking so long.

Unfortunately at the moment these are the only facts I have. I'll let you
know if I find anything new.

Josef

On 2/17/06, Jochen Wiedmann <jo...@gmail.com> wrote:
>
> Josef Bajada wrote:
>
> > I am suspecting that the XmlRpcServer.execute() method is sometimes, for
> > some reason, taking too long to execute my method.
> >
> > Any idea what part of the XmlRpcServer.execute() could take long? From a
> > quick look I gave it there doesnt seem to be anything that should take
> too
> > much time. Maybe the way the worker pool stack is working?
>
> You give us no hard facts, just questions. Knowing our code, I see no
> reason believe in problems like that you are describing. I may be wrong,
> but I would like to see facts, before banging my head.
>
> If you believe the worker pool stack to be faulty, replace it with a
> worker factory, that creates new workers all the time.
>
>
> Jochen
>



Re: XmlRpc.execute() sometimes takes long

Posted by Josef Bajada <jo...@gmail.com>.
Hi Jochen,

I am just asking if any of the developers know anything about this! I will
put some logging into the source and see which activity is taking so long.

Unfortunately at the moment these are the only facts I have. I'll let you
know if I find anything new.

Josef

On 2/17/06, Jochen Wiedmann <jo...@gmail.com> wrote:
>
> Josef Bajada wrote:
>
> > I am suspecting that the XmlRpcServer.execute() method is sometimes, for
> > some reason, taking too long to execute my method.
> >
> > Any idea what part of the XmlRpcServer.execute() could take long? From a
> > quick look I gave it there doesnt seem to be anything that should take
> too
> > much time. Maybe the way the worker pool stack is working?
>
> You give us no hard facts, just questions. Knowing our code, I see no
> reason believe in problems like that you are describing. I may be wrong,
> but I would like to see facts, before banging my head.
>
> If you believe the worker pool stack to be faulty, replace it with a
> worker factory, that creates new workers all the time.
>
>
> Jochen
>

Re: XmlRpc.execute() sometimes takes long

Posted by Jochen Wiedmann <jo...@gmail.com>.
Josef Bajada wrote:

> I am suspecting that the XmlRpcServer.execute() method is sometimes, for
> some reason, taking too long to execute my method.
> 
> Any idea what part of the XmlRpcServer.execute() could take long? From a
> quick look I gave it there doesnt seem to be anything that should take too
> much time. Maybe the way the worker pool stack is working?

You give us no hard facts, just questions. Knowing our code, I see no
reason believe in problems like that you are describing. I may be wrong,
but I would like to see facts, before banging my head.

If you believe the worker pool stack to be faulty, replace it with a
worker factory, that creates new workers all the time.


Jochen