WebLogic Startup Slow
After long WebLogic installation, I found that every time I startup WebLogic Server, it took about 10 to 15 minutes to complete. Which is unbearable and unacceptable for a production environment.
This is because JVM library used for random number generation relies on /dev/random by default for UNIX platforms. This can potentially slow down the startup before returning a result.
Although /dev/random is more secure, using /dev/urandom instead if the startup is slow. So next, we should make a comparison test on the response time of /dev/random and /dev/urandom in this machine. Please note that, the comparison test might be done at least twice.
[oracle@admin ~]$ time head -1 /dev/random
[oracle@admin ~]$ time head -1 /dev/urandom
As we can see, /dev/urandom returned the result immediately, whereas /dev/random took almost 5 minutes. Apparently, we should use /dev/urandom.
For various scopes, here are some treatments that can speed up the startup of a WebLogic server.
Please modify the setting in java.security of the default JVM.
[root@admin ~]$ vi /usr/java/default/jre/lib/security/java.security
Alternatively, we can add a JAVA_OPTIONS environment variable for every logon session of the user.
[oracle@admin ~]$ vi .bash_profile
[oracle@admin ~]$ . .bash_profile
Although we can set JAVA_OPTIONS in the session scope, adding it to the scripts is a more selective way to do it, no matter where we execute them. For example, exporting JAVA_OPTIONS in the beginning of startWebLogic.sh:
[oracle@admin ~]$ vi $DOMAIN_HOME/bin/startWebLogic.sh
Consequently, the startup is back to normal, it can be done in one minute.
Not only starting up, but installing and configuring a new domain of WebLogic are also affected by the slow random number generator. Even though, They all can be resolved by the above solutions.