axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David D. Lucas" <ddlu...@lse.com>
Subject Re: Base64 Multithreaded Locks Slow Performance
Date Wed, 26 May 2004 00:24:59 GMT
After further investigation, it appears that Sun is really locking a mutex
for creating a temporary file at the global level.  I do not understand
why they need to do that as a static.  Any ideas?  Is this a Sun bug ?

Why are we using a temporary file as a backing store anyway ?
If we have to get this thing out as a byte array, don't we still need all
that memory to handle it ?  So what is the point or am i missing
something?

Any help appreciated.

Thanks,
Dave

-- 

+------------------------------------------------------------+
| David Lucas                        mailto:ddlucas@lse.com  |
| Lucas Software Engineering, Inc.   (740) 964-6248 Voice    |
| Unix,Java,C++,CORBA,XML,EJB        (614) 668-4020 Mobile   |
| Middleware,Frameworks              (888) 866-4728 Fax/Msg  |
+------------------------------------------------------------+
| GPS Location:  40.0150 deg Lat,  -82.6378 deg Long         |
| IMHC: "Jesus Christ is the way, the truth, and the life."  |
| IMHC: "I know where I am; I know where I'm going."    <><  |
+------------------------------------------------------------+

Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt
IMHO="in my humble opinion" IMHC="in my humble conviction"
All trademarks above are those of their respective owners.


> I need a quick response.  We are working with Apache Axis CVS build May
> 18, 2004.  We are noticing that are responses are not getting back to
> the user as fast as we think they should be.  After loading up our web
> server with multiple connections and expecting 100% cpu, we only got
> 22%.  So we figured a lock of some sort was causing the issue.  After
> taking a thread stack dump we saw several threads waiting on locks under
> the BASE64 serializer.
>
> Here is the stack trace of one of several threads:
>
> "main-48" prio=5 tid=0x0000000123240c90 nid=0x2518e waiting for monitor
> entry [fffffffe74cbf000..fffffffe7
> 4cc1500]
>         at java.io.File.createTempFile(File.java:1394)
>         - waiting to lock <0xfffffffebdd657c8> (a java.lang.Object) at
> java.io.File.createTempFile(File.java:1439)
>         at
> org.apache.axis.utils.ByteArray.switchToBackingStore(ByteArray.java:257)
>         at
> org.apache.axis.utils.ByteArray.increaseCapacity(ByteArray.java:174)
>         at org.apache.axis.utils.ByteArray.write(ByteArray.java:97) at
> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
>         at
> sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:395)
>         at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:136)
>         - locked <0xfffffffec7965170> (a java.io.OutputStreamWriter) at
> java.io.OutputStreamWriter.write(OutputStreamWriter.java:191) at
> java.io.PrintWriter.write(PrintWriter.java:200)
>         - locked <0xfffffffec7965170> (a java.io.OutputStreamWriter) at
> java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111) -
> locked <0xfffffffec79651a0> (a java.io.PrintWriter)
>         at java.io.BufferedWriter.write(BufferedWriter.java:206)
>         - locked <0xfffffffec79651a0> (a java.io.PrintWriter)
>         at java.io.Writer.write(Writer.java:126)
>         at
> org.apache.axis.encoding.SerializationContextImpl.writeString(SerializationContextImpl.java:102
> 3)
>         at
> org.apache.axis.encoding.ser.Base64Serializer.serialize(Base64Serializer.java:54)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java
> :1229)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:748)
>         at
> org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:176)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java
> :1229)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:748)
>         at
> org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:176)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java
> :1229)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:748)
>         at org.apache.axis.message.RPCParam.serialize(RPCParam.java:191)
> :
>         at
> org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:350)
> at
> org.apache.axis.message.MessageElement.output(MessageElement.java:1117)
>         at
> org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
> at
> org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:470)
>         at
> org.apache.axis.message.MessageElement.output(MessageElement.java:1117)
>         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:299)
>         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:273)
>         at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:479) at
> org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:519)
>         at org.apache.axis.Message.getContentType(Message.java:472) at
> org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:697)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1808) at
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1758) at
> org.mortbay.http.HttpServer.service(HttpServer.java:879) at
> org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
> at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
>         at
> org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
> at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197)
>         at
> org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
> at
> org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501)
>
>
>
> I have not looked at the code yet, but was hoping someone on this list
> was aware of it and working on a fix.  Please let me know if there is a
> fix, otherwise I will look for a workaround.  My guess is the easiest
> path is to replace the serializer for BASE64 with my own.
>
> Any thoughts on this would be very much appreciated.
>
> Thanks,
> Dave
>
>
> --
>
> +------------------------------------------------------------+
> | David Lucas                        mailto:ddlucas@lse.com  |
> | Lucas Software Engineering, Inc.   (740) 964-6248 Voice    |
> | Unix,Java,C++,CORBA,XML,EJB        (614) 668-4020 Mobile   |
> | Middleware,Frameworks              (888) 866-4728 Fax/Msg  |
> +------------------------------------------------------------+
> | GPS Location:  40.0150 deg Lat,  -82.6378 deg Long         |
> | IMHC: "Jesus Christ is the way, the truth, and the life."  |
> | IMHC: "I know where I am; I know where I'm going."    <><  |
> +------------------------------------------------------------+
>
> Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt
> IMHO="in my humble opinion" IMHC="in my humble conviction"
> All trademarks above are those of their respective owners.
>
>
>>
>> Hey!
>>
>> You *must* update the documentation that I carefully made up to date a
>> month or two ago for WSDD elements.
>>
>> You know better. :-)
>>
>> --
>> Tom Jordahl
>> Macromedia Server Development
>>
>> -----Original Message-----
>> From: gdaniels@apache.org [mailto:gdaniels@apache.org]
>> Sent: Tuesday, May 25, 2004 3:42 PM
>> To: ws-axis-cvs@apache.org
>> Subject: cvs commit: ws-axis/java/test/wsdd PackageTests.java
>> TestGlobalConfiguration.java
>>
>> gdaniels    2004/05/25 12:41:44
>>
>>   Modified:    java/src/org/apache/axis AxisEngine.java
>>                         EngineConfiguration.java
>>                java/src/org/apache/axis/configuration
>> FileProvider.java
>>                         NullProvider.java SimpleProvider.java
>>                java/src/org/apache/axis/deployment/wsdd
>> WSDDConstants.java
>>                         WSDDDeployment.java
>> WSDDGlobalConfiguration.java
>> WSDDService.java
>>                java/src/org/apache/axis/handlers/soap SOAPService.java
>> java/test/wsdd PackageTests.java
>>                         TestGlobalConfiguration.java
>>   Log:
>>   Improve role support, and add ability to set engine and service
>> roles
>> via <role> in WSDD.
>>
>>   Revision  Changes    Path
>>   1.111     +5 -4
>> ws-axis/java/src/org/apache/axis/AxisEngine.java




Mime
View raw message