On Do, 2013-10-24 at 11:29 -0400, Stephen More wrote:
> I came across this paper by Peter Lin (
> http://tomcat.apache.org/articles/performance.pdf ). In a simple xml
> addressbook war he summarizes how different variables affect the speed
> of the application. In one test he compares:
>     Sun X1 400mhz Ultra Sparc IIe - 5 requests/sec
>     AMD 2ghz XP - 25 request/sec
> It appears that both used Tomcat 4.1.19 and Sun Jdk1.4.1_01
> 
> In an attempt to see what todays numbers look like I rebuilt the war (
> svn co https://maven-examples.googlecode.com/svn/trunk/addrbook ) and
> deployed in my environment
>     Core i7-3720 QM @ 2.60 GHz
>     SSD disk
>     java version "1.7.0_45"
>     apache-tomcat-7.0.42
> 
>     package the war - mvn package
>     execute jmeter - mvn verify
> 
> Jmeter shows my Throughput of 2.2 requests/sec ! With all the advances
> over the years ( or overhead ) are we just slowing down or are one of
> our results flawed ? ( I am running in VirtualBox - I think this would
> slow some things down - but not this much. )
> 
> Are others seeing similar results ?
I get almost the same throughput, but I don't believe it is tomcats
fault (well not directly).

If you look at the stacktraces while doing the jmeter test, you will see
very often a stack trace like this:

"http-nio-8080-exec-8" daemon prio=10 tid=0x00007fb83400b800 nid=0x2511
runnable [0x00007fb88847b000]
   java.lang.Thread.State: RUNNABLE
        at
com.sun.org.apache.xml.internal.dtm.ref.ExpandedNameTable.getExpandedTypeID(ExpandedNameTable.java:160)
        at
com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:293)
        at
com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:524)
        at
com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleFromNode(DOM2DTM.java:680)
        at
com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleOfNode(DOM2DTM.java:732)
        at
com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefault.java:576)
        - locked <0x00000000f20af5e8> (a
com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault)
        at
com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode(XPathContext.java:188)
        at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:305)
        at
org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.eval(JSTLXPathImpl.java:222)
        at
org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:287)
        at
org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:385)
        at
org.apache.taglibs.standard.tag.common.xml.XPathUtil.valueOf(XPathUtil.java:213)
        at
org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:73)
        at
org.apache.taglibs.standard.tag.el.xml.ExprTag.doStartTag(ExprTag.java:71)
        at
org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fout_005f0(simple_005f100_jsp.java:411)
        at
org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f1(simple_005f100_jsp.java:377)
        at
org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f0(simple_005f100_jsp.java:336)
        at
org.apache.jsp.simple_005f100_jsp._jspService(simple_005f100_jsp.java:118)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)


If you search for
"com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode
slow jstl" you will get to a bugzilla entry for jstl from
https://issues.apache.org/bugzilla/show_bug.cgi?id=27717 which is
closed.

That bugentry suggested, that an xslt-Transfrom would be faster, than
using <x:forEach> and if you try to replace the forEach loop with a
transform, you will get better response times (on my system throughput
went up from 1.6 r/s to 23.6 r/s for one thread. (I try to attach my
changes, but sometimes the list strips attachements...)

So either the bug has been reintroduced into jstl, or it is really slow
and should be avoided.

All in all I think you should do your performance tests with a more
modern benchmark. It would be best, if it would expose your expected
workload and not someone others.

Regards
 Felix

> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

Attachment: transform_simple.xslt
Description: application/xslt

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to