Michael,

On 8/12/21 11:05, Michael Richardson wrote:
I am trying to deploy OSCAR-EMR

Wow, that still exists? I remember more than a decade ago being asked to integrate a product at $work with that thing as a demo. We never did, because the market seemed not to really exist. I see you are in Canada. I know OSCAR same from McMaster University. Does it have a good ecosystem and install base in CA?

in a new location (for my wife's office), with better encryption and
database replication.  We have an existing bare-metal instance
running that her boss assembled. It's fragile, but it runs.

In both ubuntu 18.04 and devuan beowulf VMs, I can start up tomcat9
and openjdk (8 or 11) and talk to the tomcat9-admin interface.

I then deploy the oscar.war to /var/lib/tomcat19/webapps, and observe
in htop that I get 5-6 threads that get very busy, as it extracts the app.

Hmm. I wouldn't expect more than 1 thread to get busy extracting that application.

Then, port 8080 stops responding.  And also I see new connections just stall.

I wind up with two threads of java each chewing 100% of the CPU.
strace on it doesn't help, telling me that it looks like 32-bit code.
I think that the JIT might confuse it.  Are these threads doing I/O or system
calls? I can't tell.

(I can see the new connections stalling in netstat -tan, with unprocessed
bytes in the recv Q)

If I stop the java processes, and restart them, then they seem to continue
the "deploy", even if I have removed the oscar.war and
/var/lib/tomcat19/webcaps/oscar directory.  Clearly something else remembers
it.  When that happens, I get *no output* in catalina.out.

What makes you think those threads are continuing to deploy the WAR file? If the WAR file is missing, deployment would be most difficult. When you remove the WAR file, are you also removing the exploded-WAR-directory that Tomcat creates during the deployment of the WAR?

And _apt-get purge tomcat9_, and re-install, gets me back to the start, but I'd
like to understand where the deploy is being recorded and how I can undo only
that.

I will get one message that I am trying to look at the cacheMaxSize
value in /etc/tomcat9/context.xml.
   <dang, that log file got deleted>

My question is, if the cacheMaxSize is too small, will it lead to some kind
of continual cache replacement where it never actually starts up?
If so, is there some debug that would let me estimate what an appropriate
cache size is?  The running machine has:
    <Resources cachingAllowed="true" cacheMaxSize="100000" />

(I initially suspected the whole /dev/random issue, so I moved the TLS
to a proxy-pass Apache, but also I have virtio /dev/random, and I also
ln /dev/urandom to /dev/random just in case...)

Okay, I don't mean to sound mean, but it sounds like you have no idea what's going on, here. There are probably several issues, but let's start with the first one: what are those threads doing at 100% CPU.

You don't have a /dev/random problem, because really nobody has that problem anymore. Also, the /dev/random problem manifests as a "hung" server with *zero* CPU usage.

Reset your environment back to the beginning: fresh Tomcat, no log files, no WAR deployed or anything like that. Start up Tomcat and make sure everything looks good so far. Then deploy the WAR file and let everything go to hell. After things settle down and you are in your "2 threads eating the CPU" situation, do the following:

1. Grab the log file in CATALINA_BASE/logs/catalina.out (or similar)
2. Take a thread-dump of the running JVM[1]

Sanitize the files in whatever way is necessary and post them back to this mailing list and we'll take a look.

-chris

[1] https://cwiki.apache.org/confluence/display/TOMCAT/HowTo#HowTo-HowdoIobtainathreaddumpofmyrunningwebapp?

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

Reply via email to