Start of Lucee takes round about 15 minutes

Good morning,

after upgrade Ubuntu 14.04 to 16.04 Tomcat takes a long time (round about 15 min) for start.
In this case it is one of our test system, so it is not critical, but i want to Update first product system next days, so it would be fine, if you could help me.

Perhaps somebody has an idea.

Best,
Carsten

Dez 19, 2016 11:02:09 PM org.apache.catalina.startup.Catalina load
INFORMATION: Initialization processed in 800 ms
Dez 19, 2016 11:02:09 PM org.apache.catalina.core.StandardService startInternal
INFORMATION: Starting service Catalina
Dez 19, 2016 11:02:09 PM org.apache.catalina.core.StandardEngine startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/7.0.56
Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8
.0
Java HotSpot™ 64-Bit Server VM warning: ignoring option PermSize=340M; support was removed in 8.0
Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=340M; support was removed in 8
.0
Dez 19, 2016 11:09:54 PM org.apache.catalina.core.AprLifecycleListener init
INFORMATION: The APR based Apache Tomcat Native library which allows optimal performance in productio
n environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64
:/lib:/usr/lib
Dez 19, 2016 11:09:54 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler [“http-bio-8888”]
Dez 19, 2016 11:09:54 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler [“ajp-bio-8009”]
Dez 19, 2016 11:09:54 PM org.apache.catalina.startup.Catalina load
INFORMATION: Initialization processed in 667 ms
Dez 19, 2016 11:09:54 PM org.apache.catalina.core.StandardService startInternal
INFORMATION: Starting service Catalina
Dez 19, 2016 11:09:54 PM org.apache.catalina.core.StandardEngine startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/7.0.56
Dez 19, 2016 11:24:08 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFORMATION: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [850,7
11] milliseconds.
lucee-server-root:/opt/railo/lib/lucee-server===================================================================
SERVER CONTEXT

  • config:/opt/railo/lib/lucee-server/context
  • loader-version:4.3
    ===================================================================

Mon Dec 19 23:24:08 CET 2016-814 using JRE Date Library
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/railo/lib/railo-sl4j.jar!/org/slf4j/impl/StaticLoggerBinder.cl
ass]
SLF4J: Found binding in [jar:file:/opt/railo/lib/slf4j-nop.jar!/org/slf4j/impl/StaticLoggerBinder.cla
ss]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Mon Dec 19 23:24:09 CET 2016-474 Start CFML Controller
Mon Dec 19 23:24:09 CET 2016 Loaded Lucee Version 4.5.4.017

It was all spent in the SecureRandom generation. (850711 milliseconds)

First, you may want to consider installing the libtcnative-1 package.
That’ll fix this:

The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

Second, you should set the random source device - likely Java is blocking
trying to read entropy from /dev/random.

Add this command line argument to your Java/Tomcat startup:

-Djava.security.egd=file:/dev/./urandom

You would do this where you set your JAVA_OPTS argument for tomcat. I’ve
added things to bin/setclasspath.sh before, or you can populate JAVA_OPTS
before calling the tomcat start scripts.

The bottom of my setclasspath.sh in dev:
export
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/${LD_LIBRARY_PATH:-:$LD_LIBRARY_PATH}

export JAVA_OPTS="-Xms2048M -Xmx3192M ${JAVA_OPTS}"

Tells Tomcat where to find libtcnative, and sets some reasonable memory
limits for dev. You can add these lines and set the egd options here.
(Other options might be useful too:
-Djava.awt.headless=true
-Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE=true
(this fixes ACF cflogin)

YMMV

Since you say this happened after an upgrade, you may want to check the
java.security file of your JVM.

For instance on Trusty, my java.security file
in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/ says:#

Select the source of seed data for SecureRandom. By default an

attempt is made to use the entropy gathering device specified by

the securerandom.source property. If an exception occurs when

accessing the URL then the traditional system/thread activity

algorithm is used.

On Solaris and Linux systems, if file:/dev/urandom is specified and it

exists, a special SecureRandom implementation is activated by default.

This “NativePRNG” reads random bytes directly from /dev/urandom.

On Windows systems, the URLs file:/dev/random and file:/dev/urandom

enables use of the Microsoft CryptoAPI seed functionality.

securerandom.source=file:/dev/urandom

If for whatever reason that file says /dev/random instead of /dev/urandom,
you may experience delays any time Java needs to gather entropy for random
numbers. (Though your command line argument above will override it - just
explaining why behavior might have changed.)

Joe

On Tue, Dec 20, 2016 at 2:26 AM, Carsten Klement <@Carsten_Klement wrote:

Good morning,

after upgrade Ubuntu 14.04 to 16.04 Tomcat takes a long time (round about
15 min) for start.
In this case it is one of our test system, so it is not critical, but i
want to Update first product system next days, so it would be fine, if you
could help me.

Perhaps somebody has an idea.

Best,
Carsten

Dez 19, 2016 11:02:09 PM org.apache.catalina.startup.Catalina load
INFORMATION: Initialization processed in 800 ms
Dez 19, 2016 11:02:09 PM org.apache.catalina.core.StandardService
startInternal
INFORMATION: Starting service Catalina
Dez 19, 2016 11:02:09 PM org.apache.catalina.core.StandardEngine
startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/7.0.56
Java HotSpot™ 64-Bit Server VM warning: ignoring option
MaxPermSize=128m; support was removed in 8
.0
Java HotSpot™ 64-Bit Server VM warning: ignoring option PermSize=340M;
support was removed in 8.0
Java HotSpot™ 64-Bit Server VM warning: ignoring option
MaxPermSize=340M; support was removed in 8
.0
Dez 19, 2016 11:09:54 PM org.apache.catalina.core.AprLifecycleListener
init
INFORMATION: The APR based Apache Tomcat Native library which allows
optimal performance in productio
n environments was not found on the java.library.path:
/usr/java/packages/lib/amd64:/usr/lib64:/lib64
:/lib:/usr/lib
Dez 19, 2016 11:09:54 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler [“http-bio-8888”]
Dez 19, 2016 11:09:54 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler [“ajp-bio-8009”]
Dez 19, 2016 11:09:54 PM org.apache.catalina.startup.Catalina load
INFORMATION: Initialization processed in 667 ms
Dez 19, 2016 11:09:54 PM org.apache.catalina.core.StandardService
startInternal
INFORMATION: Starting service Catalina
Dez 19, 2016 11:09:54 PM org.apache.catalina.core.StandardEngine
startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/7.0.56
Dez 19, 2016 11:24:08 PM org.apache.catalina.util.SessionIdGenerator
createSecureRandom
INFORMATION: Creation of SecureRandom instance for session ID generation
using [SHA1PRNG] took [850,7
11] milliseconds.
lucee-server-root:/opt/railo/lib/lucee-server

SERVER CONTEXT

  • config:/opt/railo/lib/lucee-server/context
  • loader-version:4.3
    ===================================================================

Mon Dec 19 23:24:08 CET 2016-814 using JRE Date Library
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/railo/lib/
railo-sl4j.jar!/org/slf4j/impl/StaticLoggerBinder.cl
ass]
SLF4J: Found binding in [jar:file:/opt/railo/lib/
slf4j-nop.jar!/org/slf4j/impl/StaticLoggerBinder.cla
ss]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
Mon Dec 19 23:24:09 CET 2016-474 Start CFML Controller
Mon Dec 19 23:24:09 CET 2016 Loaded Lucee Version 4.5.4.017

–
You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/1435662301.63574.1482218778914.JavaMail.zimbra%
40carsten-klement.de.
For more options, visit https://groups.google.com/d/optout.

1 Like

sudo apt-get install haveged will solve the problem!