You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Sutton, Ray" <Ra...@den.galileo.com> on 2003/10/09 20:31:54 UTC

RE: Performance Issues with AXIS & Axis Response Time appears lin ear with load

Hello, 

Not sure if you're seeing the same problem as me (see thread RE: Axis
Response Time appears linear with load) but here's what I discovered in case
it helps.

I'm seeing traffic backup behind a synchronized call in
org.apache.axis.XMLUtils at line 317 (entire method follows) 

    public static Document newDocument(InputSource inp)
        throws ParserConfigurationException, SAXException, IOException
    {
        DocumentBuilder db;
        synchronized (dbf) {
            db = dbf.newDocumentBuilder();
        }
        db.setEntityResolver(new DefaultEntityResolver());
        db.setErrorHandler( new ParserErrorHandler() );
        return( db.parse( inp ) );
    }


Now dbf is an instance of "javax.xml.parsers.DocumentBuilderFactory" which
is an abstraction layer around the chosen XML parser in my case it resolves
to "org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"  the method called
under the  synchronized block is:

    public DocumentBuilder newDocumentBuilder()
        throws ParserConfigurationException 
    {
	DocumentBuilderImpl db = new DocumentBuilderImpl(this);
        return db;
    }

The constructor for DocumentBuilderImpl is doing a fair amount of work, time
constraints prevent me looking any deeper but I don't see any obvious need
for synchronization of this process.

What I suspect is that the good folks that develop Axis have synchronized
this because they can make no assumption about the implementation that
javax.xml.parsers.DocumentBuilderFactory abstracts. If this is the case then
I seems to me that the sync belongs in the DBF implementation not its
caller.

My personal instinct, unless anyone knows a good reason not, would be to
remove this specific synchronization point. 

Thanks

Ray Sutton
Systems Engineer

-----Original Message-----
From: Suket.N.Gandhi@wellsfargo.com [mailto:Suket.N.Gandhi@wellsfargo.com] 
Sent: Friday, October 03, 2003 2:09 PM
To: axis-user@ws.apache.org
Subject: Performance Issues with AXIS
Importance: High

Hi,

We are using Apache AXIS 1.1 to support a web service that returns images.
The images are base-64 encoded and embedded within the XML.
What we are seeing is very slow response times with AXIS when it tries to
construct the SOAP XML.The size of the images are in the range 50-100KB.

We are not sure if the large amount of data is the cause of the problem or
if we should be doing something else to overcome this problem ?

Thanks

Suket



The information in this electronic mail message is sender's business
Confidential and may be legally privileged.  It is intended solely for the
addressee(s).  Access to this Internet electronic mail message by anyone
else is unauthorized.  If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it is prohibited and may be unlawful. 
The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message and
its attachments could have been infected during  transmission. By reading
the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. Galileo International is not liable for any loss or damage
arising in any way from this message or its attachments.



RE: Performance Issues with AXIS & Axis Response Time appears linear with load

Posted by Robert Lowe <rm...@rmlowe.com>.
> My personal instinct, unless anyone knows a good reason not, would be to
> remove this specific synchronization point.

The docs are quite specific that a DocumentBuilderFactory is *not*
guaranteed to be thread-safe:

http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilderFac
tory.html

As noted in the docs, it's fine to have one DocumentBuilderFactory per
thread though.



Best regards,

Robert Lowe
http://RMLowe.com/