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" />