On Tue, Jan 4, 2022 at 2:50 PM Mark Thomas <ma...@apache.org> wrote: > > > On 04/01/2022 19:23, Robert J. Carr wrote: > > I've been using tomcat for many years but unfortunately I'm stuck on > > version 7 (long story). I recently picked up a new workstation, an Apple > > M1 MacBook (M1 Max - macOS 12.1), and I installed the ARM version of Azul > > Zulu (1.8.0_312), and by all accounts everything is really fast, as you'd > > expect. A compile that took about 3.5 minutes on a 2016 x86 MacBook now > > takes about 50 seconds on ARM. > > > > However, deploying web applications (context deploy via web service) is > > much slower compared to x86. One app used to take about 3-4 seconds and > > the other near instantaneous are now taking 42 and 11 seconds, > > respectively, and very consistently. The same is true for tomcat > restarts > > when the custom apps are registered. Without any custom apps tomcat > starts > > in under one second. App reloads are a bit faster than deploy, but still > > very slow compared to x86. The only thing different I can tell is the > > workstation (and thus, architecture). > > > > I started on Tomcat version 7.0.109 (newest at the time), but reverted > to a > > known working 7.0.76 thinking it might be the issue, but nothing changed, > > i.e., still noticing the huge delay during deployment, down to the same > > amount of delay time. > > > > The only noticeable issue in the logs is this line: > > > >> At least one JAR was scanned for TLDs yet contained no TLDs. Enable > debug > > logging for this logger for a complete list of JARs that were scanned but > > no TLDs were found in them. > > > > This was also in the x86 logs that I never addressed, so I think it's a > red > > herring; however, when monitoring the logs after a deploy, that is the > last > > line printed before it idles for 10-40 seconds. Also, the application > with > > more jar files is the one that takes longer to start, so I thought I'd > > investigate. > > > > I started by adding this to 'logging.properties' > > > > org.apache.jasper.compiler.TldLocationsCache.level = FINE > > > > But nothing new was printed, even when setting to FINEST. Researching > > around, and reading 'catalina.properties', I added all of the jars from > the > > web application to this property: > > > > org.apache.catalina.startup.TldConfig.jarsToSkip=... > > > > And the TLD warning went away, but the long multi-second pause persisted. > > Searching around more, I came across this document: > > > > > https://cwiki.apache.org/confluence/display/TOMCAT/HowTo+FasterStartUp > > > > I had already added the entropy fix to my startup script (and I don't see > > any SecureRandom warnings in the logs): > > > > -Djava.security.egd=file:/dev/./urandom > > > > So that doesn't appear to be related to my issue. > > > > As I said, my config is now exactly the same as it was on x86, so > anything > > new I try from here is just completely guessing. I'm hoping somebody has > > an idea so I can stop guessing. > > > > Please let me know if there's any information that would help, but I > tried > > to provide all of the relevant details I know of. > > My usual advice is to get a profiler and see what is going on. > > I use YourKit - primarily because they give me a free license to use for > Tomcat development. Other profilers are available. > > Mark > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > Hi Mark-
Thanks so much for the profiler recommendation; I'm old enough that I should have considered this, but I thought it was some deep issue with tomcat related somehow to the new architecture. Turns out I was wrong. The issue was actually from doing an 'InetAddress.getLocalHost()' call, from within log4j, and this was causing a 5 second timeout. My guess is log4j is making this call once per logger/appender, and since my larger application has more of these, that's why it was taking so much longer for that one. So why is it timing out? Seems to be a peculiarity with java 8 and macOS and looks to still exist. See here: https://stackoverflow.com/questions/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds https://stackoverflow.com/questions/39636792/jvm-takes-a-long-time-to-resolve-ip-address-for-localhost/39698914#39698914 Since this is a new workstation I hadn't touched the hosts file and that was the difference compared to my previous config (which I must have set just by coincidence). So, false alarm, nothing to do with tomcat, but thanks again for leading me in the right direction! Cheers- Robert