Re: how to tune cacheMaxSize

2021-08-20 Thread Michael Richardson

Christopher Schultz  wrote:
>> NOTE: Picked up JDK_JAVA_OPTIONS:  
--add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.io=ALL-UNNAMED 
--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.ba
>> se/java.util.concurrent=ALL-UNNAMED 
--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
>> ^Z
>> [1]+  Stopped $CATALINA_HOME/bin/catalina.sh run

> How long did you wait before hitting CTRL-Z there?

at least 5 minutes.

>> tomcat@oscar-serv03:/opt/apache-tomcat-9.0.52$ bg
>> [1]+ $CATALINA_HOME/bin/catalina.sh run &

> Well, now things are complicated because you backgrounded the process.

Well, either it tries to write to stdout and gets blocked (and suspended) on
SIGTOUT, or it doesn't.
Background processes still get to write to stdout by default.

--
]   Never tell me the odds! | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works|IoT architect   [
] m...@sandelman.ca  http://www.sandelman.ca/|   ruby on rails[



signature.asc
Description: PGP signature


Re: how to tune cacheMaxSize

2021-08-20 Thread Michael Richardson

Christopher Schultz  wrote:
> That's quite a long time (1643381ms), and the timestamps match-up.

> So you tried to get a thread-dump during this 27-minute period and the
> process simply wouldn't respond?

Correct.

> It is during this 27-minute period that the CPU is pegged?

Correct.

> Do you see anything in the kernel logs? Like dmesg.log or kernel.log or
> whatever Ubuntu logs to?

Nothing.

> Well, the application deployment(s) are happening somewhat quickly. 13
> seconds is a long time IMO to wait for manager and the other rather 
trivial
> web applications to load, but that points to something more like a slow 
disk
> or CPU or something.

I can investigate this a bit.
I spent several days this week cleaning out a data center, so some different
hardware has come my way.  Perhaps I'll try that out.



signature.asc
Description: PGP signature


Re: Apache Tomcat 9 | Tomcat starting issue

2021-08-20 Thread Christopher Schultz

Piyush,

On 8/20/21 06:36, Piyush Sharma wrote:


Hello,

I am using Apache Tomcat 9.0.46 version on docker container.

There is a problem, where the base path was wrongly set by automation
script due to which it starts for few seconds, listen port 8080 and then
stop, due to that container exit after sometime.



Now how can we debug such issue, which shows any error / problem in tomcat

configuration.

I tried with "jpda start" or "debug" options, but that didn't help me. Is
there any option to debug tomcat related issues or problems.

"catalina.sh configtest" will show any error in xml or properties but will
not help to debug tomcat startup problem.

*Note:* I am just deploying with the helloworld war file. nothing much in
code as of now.


Maybe just fix your automation script to use the right path?

It's hard to understand what the problem is given the information you 
have presented.


-chris

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



Re: how to tune cacheMaxSize

2021-08-20 Thread Christopher Schultz

Michael,

On 8/19/21 21:34, Michael Richardson wrote:


Aha.  Well, I left it running after the last email and went on to more
important things.  Then the window just jumped:

The previous log line:
20-Aug-2021 01:02:42.315 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL 
successfully initialized [OpenSSL 1.1.1  11 Sep 2018]

Then it acted on the ^\ I had sent.  And then it printed:
Could it have spent that time initializing OpenSSL?


It's possible, but not super-likely:


20-Aug-2021 01:02:42.083 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djava.io.tmpdir=/opt/apache-tomcat-9.0.52/temp
20-Aug-2021 01:02:42.210 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent An older version 
[1.2.21] of the Apache Tomcat Native library is installed, while Tomcat 
recommends a minimum version of [1.2.30]
20-Aug-2021 01:02:42.213 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache 
Tomcat Native library [1.2.21] using APR version [1.6.3].
20-Aug-2021 01:02:42.215 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: 
IPv6 [true], sendfile [true], accept filters [false], random [true], UDS 
[false].
20-Aug-2021 01:02:42.217 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL 
configuration: useAprConnector [false], useOpenSSL [true]
20-Aug-2021 01:02:42.315 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL 
successfully initialized [OpenSSL 1.1.1  11 Sep 2018]


All of the above logs are printed within s fraction of a second of each 
other. OpenSSL initialization is taking essentially zero time.



20-Aug-2021 01:29:58.867 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing 
ProtocolHandler ["http-nio-8080"]
20-Aug-2021 01:29:59.917 INFO [main] org.apache.catalina.startup.Catalina.load 
Server initialization in [1643381] milliseconds


That's quite a long time (1643381ms), and the timestamps match-up.

So you tried to get a thread-dump during this 27-minute period and the 
process simply wouldn't respond?


It is during this 27-minute period that the CPU is pegged?

Do you see anything in the kernel logs? Like dmesg.log or kernel.log or 
whatever Ubuntu logs to?



20-Aug-2021 01:30:01.832 INFO [main] 
org.apache.catalina.core.StandardService.startInternal Starting service 
[Catalina]
20-Aug-2021 01:30:01.837 INFO [main] 
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: 
[Apache Tomcat/9.0.52]
20-Aug-2021 01:30:01.997 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [/opt/apache-tomcat-9.0.52/webapps/manager]
20-Aug-2021 01:30:06.559 WARNING [main] 
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of 
SecureRandom instance for session ID generation using [SHA1PRNG] took [248] 
milliseconds.
20-Aug-2021 01:30:07.109 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [/opt/apache-tomcat-9.0.52/webapps/manager] has finished 
in [5,111] ms
20-Aug-2021 01:30:07.117 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [/opt/apache-tomcat-9.0.52/webapps/examples]
20-Aug-2021 01:30:12.192 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [/opt/apache-tomcat-9.0.52/webapps/examples] has finished 
in [5,074] ms
20-Aug-2021 01:30:12.195 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [/opt/apache-tomcat-9.0.52/webapps/docs]
20-Aug-2021 01:30:12.449 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [/opt/apache-tomcat-9.0.52/webapps/docs] has finished in 
[253] ms
20-Aug-2021 01:30:12.451 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [/opt/apache-tomcat-9.0.52/webapps/ROOT]
20-Aug-2021 01:30:12.697 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [/opt/apache-tomcat-9.0.52/webapps/ROOT] has finished in 
[245] ms
20-Aug-2021 01:30:12.700 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [/opt/apache-tomcat-9.0.52/webapps/host-manager]
20-Aug-2021 01:30:12.990 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [/opt/apache-tomcat-9.0.52/webapps/host-manager] has 
finished in [290] ms
20-Aug-2021 01:30:13.095 INFO [main] org.apache.coyote.AbstractProtocol.start Starting 
ProtocolHandler ["http-nio-8080"]
20-Aug-2021 01:30:13.254 INFO [main] org.apache.catalina.startup.Catalina.start 
Server startup in [1] milliseconds


Well, the application deployment(s) are 

Re: how to tune cacheMaxSize

2021-08-20 Thread Christopher Schultz

Michael,

On 8/19/21 20:35, Michael Richardson wrote:


try #1.  Now rebooting VM.

Christopher Schultz  wrote:
 > 1. Stop Tomcat, clear all logs, delete your oscar.war file and the 
exploded
 > directory in CATALINA_BASE/webapps/oscar (or wherever your appBase points
 > to).
 > 2. Copy your oscar.war file into appBase, making sure that operation
 > completes
 > 3. Start Tomcat, but like this instead of what you usually do:

 > $ sudo -iu tomcatuser
 > $ $CATALINA_BASE/bin/catalina.sh run

I have not done #2.  I figure it should start up correctly, right?
My $CATALINA_BASE/webapps contains:

oscar-serv03-[/opt/apache-tomcat-9.0.52/webapps] root 7 #ls -lta
total 28
drwxr-x---  6 tomcat root 4096 Aug 16 20:28 manager/
drwxr-x---  6 tomcat root 4096 Aug 16 20:28 host-manager/
drwxr-x---  7 tomcat root 4096 Aug 16 20:28 examples/
drwxr-x--- 15 tomcat root 4096 Aug 16 20:28 docs/
drwxr-x---  3 tomcat root 4096 Aug 16 20:28 ROOT/
drwxr-xr-x  9 tomcat root 4096 Aug 16 20:28 ../
drwxr-x---  7 tomcat root 4096 Jul 31 04:12 ./

tomcat@oscar-serv03:/opt/apache-tomcat-9.0.52$ $CATALINA_HOME/bin/catalina.sh 
run
Using CATALINA_BASE:   /opt/apache-tomcat-9.0.52
Using CATALINA_HOME:   /opt/apache-tomcat-9.0.52
Using CATALINA_TMPDIR: /opt/apache-tomcat-9.0.52/temp
Using JRE_HOME:/usr/lib/jvm/java-11-openjdk-amd64
Using CLASSPATH:   
/opt/apache-tomcat-9.0.52/bin/bootstrap.jar:/opt/apache-tomcat-9.0.52/bin/tomcat-juli.jar
Using CATALINA_OPTS:
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.io=ALL-UNNAMED 
--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.ba
se/java.util.concurrent=ALL-UNNAMED 
--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
^Z
[1]+  Stopped $CATALINA_HOME/bin/catalina.sh run


How long did you wait before hitting CTRL-Z there?


tomcat@oscar-serv03:/opt/apache-tomcat-9.0.52$ bg
[1]+ $CATALINA_HOME/bin/catalina.sh run &


Well, now things are complicated because you backgrounded the process.


futzing with right options to ps to show threads:

tomcat   30113 30053 30113  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30117 98   17 00:28 pts/300:01:15 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30118  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30119  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30120  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30121  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30122  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30123  7   17 00:28 pts/300:00:05 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30124  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30125  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30126  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30127  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30128  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30129  1   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30130  0   17 00:28 pts/300:00:00 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.52/conf/logging.properties
tomcat   30113 30053 30131  0   17 00:28 pts/300:00:00 

Re: how to tune cacheMaxSize

2021-08-20 Thread Christopher Schultz

Michael,

On 8/19/21 21:37, Michael Richardson wrote:

Let's deploy the oscar.war, what's the worst that can happen?

20-Aug-2021 01:36:10.129 WARNING [Catalina-utility-1] 
org.apache.catalina.webresources.Cache.getResource Unable to add the resource 
at [/WEB-INF/classes/oscar/ocan/testdata/ocan_v1.0.1.xml] to the cache for web 
application [/oscar] because there was insufficient free space available after 
evicting expired cache entries - consider increasing the maximum size of the 
cache
... repeated many times.

This was among the original message that lead to this original subject line.


Hmm. Given that file name, it looks like the OSCAR WAR file ships with 
testing data inside of it. Tomcat tries to cache items which is why you 
are getting this warning.


For now, I think you can safely ignore these warnings. They will only 
(negatively) affect the performance of your Tomcat/OSCAR deployment, but 
they shouldn't break anything.


The maximum cache size is set by default to 10MiB. If you have more RAM, 
feel free to increase that number as high as you feel is appropriate.


-chris

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



Re: Apache Tomcat 9 | Tomcat starting issue

2021-08-20 Thread Piyush Sharma
>
> Hello,
>
> I am using Apache Tomcat 9.0.46 version on docker container.
>
> There is a problem, where the base path was wrongly set by automation
> script due to which it starts for few seconds, listen port 8080 and then
> stop, due to that container exit after sometime.
>

Now how can we debug such issue, which shows any error / problem in tomcat
> configuration.
>
> I tried with "jpda start" or "debug" options, but that didn't help me. Is
> there any option to debug tomcat related issues or problems.
>
> "catalina.sh configtest" will show any error in xml or properties but will
> not help to debug tomcat startup problem.
>
> *Note:* I am just deploying with the helloworld war file. nothing much in
> code as of now.
>
> Thanks
> Piyush
>


ApacheCon@Home, Tomcat-Track, request for input ...

2021-08-20 Thread Rony G. Flatscher (Apache)
Hi there,

in a month ApacheCom@Home 2021 [1] starts and has a Tomcat Track [2] in which I 
will present a talk
"Apache Tomcat: Enabling Scripting Languages in JSPs" [3]. About getting ready 
to prepare the slides
and samples I was wondering whether anyone in the Tomcat community would have 
questions, ideas,
suggestions, curiosities etc. and would kindly request for input if you have 
any.

---rony

[1] ApacheCon@Home 2021: 
[2] Tomcat track: 
[3] Apache Tomcat: Enabling Scripting Languages in JSPs:




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