1

I've just installed a new server (Xeon E5-2630 v4,256GB RAM, Ubuntu 18, Tomcat 8, Java 8) to replace the current 4 year old one (i5-2400, 8GB RAM, Ubuntu 14, Tomcat 7, Java 7) and during testing found that on one large-ish test page the new server is over 10 times slower than the old one. A bit of digging later and that is also the case running Tomcat 8 (installed with apt-get) on my dev machine (Java 8), but not when running the Spring Tool Suite bundled tc server (also based on Tomcat8!)

Test results on sample page. Same spring application war file on all 4 instances. Run locally, the app logs the page generation time in the controller and that's roughly the same on all 4, so the problem must be in the jsp generation or (most likely imo) in the connection:

time wget http://localhost:8080/proteus/testpage 
  • Old Server: 4,643,048 bytes 5.88M/s in 0.8s
  • New Server: 4.43M 276KB/s in 16s
  • Dev Machine tcServer (based on Tomcat8): 4.43M 4.24MB/s in 1.0s
  • Dev machine Tomcat 8: 4.43M 318KB/s in 14s

For that large a difference on the same machine I must be missing something pretty fundamental in the connection setup/configuration but I've been troubleshooting for most of the last 2 days and not made any headway.

If anyone has any suggestions for what to look at I'd be very grateful. Working on the dev machine seems simplest so I've appended some info from there.

Regards.


Heap is set to -Xmx768m on tcServer, -Xmx2048m on Tomcat 8.

tcServer version info:

Using CATALINA_BASE:   /home/mjames/sts-bundle/pivotal-tc-server-developer-3.1.5.RELEASE/tomcat-8.0.36.A.RELEASE
Using CATALINA_HOME:   /home/mjames/sts-bundle/pivotal-tc-server-developer-3.1.5.RELEASE/tomcat-8.0.36.A.RELEASE
Using CATALINA_TMPDIR: /home/mjames/sts-bundle/pivotal-tc-server-developer-3.1.5.RELEASE/tomcat-8.0.36.A.RELEASE/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /home/mjames/sts-bundle/pivotal-tc-server-developer-3.1.5.RELEASE/tomcat-8.0.36.A.RELEASE/bin/bootstrap.jar:/home/mjames/sts-bundle/pivotal-tc-server-developer-3.1.5.RELEASE/tomcat-8.0.36.A.RELEASE/bin/tomcat-juli.jar
Server version: Pivotal tc Runtime 3.1.5.RELEASE/8.0.36.A.RELEASE
Server built:   Jun 29 2016 20:36:49 UTC
Server number:  8.0.36.0
OS Name:        Linux
OS Version:     4.4.0-116-generic
Architecture:   amd64
JVM Version:    1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12
JVM Vendor:     Oracle Corporation

tomcat 8 version info:

Using CATALINA_BASE:   /usr/share/tomcat8
Using CATALINA_HOME:   /usr/share/tomcat8
Using CATALINA_TMPDIR: /usr/share/tomcat8/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.0.32 (Ubuntu)
Server built:   Sep 27 2017 21:23:18 UTC
Server number:  8.0.32.0
OS Name:        Linux
OS Version:     4.4.0-116-generic
Architecture:   amd64
JVM Version:    1.8.0_162-8u162-b12-0ubuntu0.16.04.2-b12
JVM Vendor:     Oracle Corporation

connector from server.xml (same on both, stripped them down to basics)

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"  
           URIEncoding="UTF-8" redirectPort="8443" />
mjames276
  • 61
  • 6

2 Answers2

0

check the defaults

Tomcat and tc Server are packaged as different offerings:

  • Tomcat is very universal and heavily configurable servlet container.

  • tc Server is a fuller, more production ready Tomcat compatible application server.

See here for more extensive comparison of the 2 servers.

As a result, their defaults are different. Tomcat by default is configured as a smaller thing, while tc Server makes bolder assumptions by default.

See Tomcat's default properties vs. tc Server default ones (and after vertigo caused by the amount of available options subsides) see for example that tomcat has 200 as max number of threads while tc server uses 300.

As you can imagine, there are numerous settings which will influence the performance of your test page.

diginoise
  • 6,666
  • 1
  • 25
  • 32
0

Found a solution, if not exactly an answer - I never got to the bottom of the issue with tomcat 8.0 but I installed 8.5.29 from a tar file on the new server and the performance on that is ok. Test page downloads in 2 seconds (as opposed to 16s on Tomcat 8.0) still a little slower than the old one in the UK but it is in Germany, it's acceptable at least, I can try and optimise further at a later date...

Exactly the same JRE (OpenJDK 1.8.0_162), War file and server.xml, everything else is the default config except for the following in setenv.sh

CATALINA_OPTS="-Xmx4096m -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.1,TLSv1.2 -Djdk.tls.client.protocols=TLSv1.1,TLSv1.2 -Djava.awt.headless=true"
mjames276
  • 61
  • 6