tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat 7 to 8 Upgrade - Performance Degradation
Date Wed, 06 Aug 2014 11:49:38 GMT
Hash: SHA256


On 8/5/14, 7:54 PM, Peter Rifel wrote:
> I am in the process of upgrading from Tomcat 7.0.54 to Tomcat 8.0.9
> and am seeing some performance degradation in my webapp.
> Configuration info:
> Ubuntu 14.04.1 LTS java version "1.8.0_11" Java(TM) SE Runtime
> Environment (build 1.8.0_11-b12) Java HotSpot(TM) 64-Bit Server VM
> (build 25.11-b03, mixed mode)
> Both versions of tomcat use the APR Connector with TC Native
> 1.1.31 statically linked against APR 1.5.1 and OpenSSL 1.0.1h
> I'm running identical requests to identical web apps between these
> tomcats and in Tomcat 8 I'm seeing an ~20% response time increase
> and as such a similar reqs / sec decrease.  After using VisualVM to
> profile the application I've narrowed it down to the JRE's JAXP
> library taking significantly longer to create its xml validation
> "SchemaFactory" which doesn't make sense to me because I'm using
> the same JRE in both tests.

To me, this suggests other factors that haven't been controlled, like
GC activity or something else. Are you sure you have a good
steady-state test?

Any chance you could create a single SchemaFactory object and then
synchronize access to it? It might reduce contention. Another
possibility is to use a ThreadLocal (which has its own dangers).

> I know that the Resources implementation was overhauled in Tomcat 8
> so is there any possibility that this could be a side effect?  For
> a better idea of what I'm talking about, see the below VisualVM
> screenshots of a profiling snapshot's call tree:
> Tomcat 7 - Notice how the time spent
> in the javax.xml.validation.* methods is <6%
> Tomcat 8 - Notice how the time spent
> in these methods is significantly higher.

Does the "validation" time include loading the schema itself from
wherever it is located?

> Again, I'm confused as to how the performance of the JRE's library
> changes between tomcat versions, can anyone explain this to me or
> point me in the right direction on where to look?  Is it as simple
> as a config change or will it require a java code change?  The
> XmlUtils.validate method you see in the screenshot is simply the
> following:
> javax.xml.validation.SchemaFactory factory = 
> SchemaFactory.newInstance("");
> Here are the Tomcat configurations:
> Tomcat 8 server.xml: Tomcat 8
> context.xml:
> Tomcat 7 server.xml: Tomcat 7
> context.xml:
> Does anyone have any idea why this might be performing so
> differently between versions of tomcat?  Could it be a bug in the
> JRE?  I can try and provide test code for repro if it helps.

- -chris
Version: GnuPG v1
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message