Weblogic process startup hangs or delays

Weblogic server [Admin ] is taking long time to start more than 10 min which is unusual . can we increase the performance by some means ?? Yes we can verify the random number that may be one of the cause during weblogic startup .

Weblogic server [Admin ] is taking long time to start more than 10 min which is unusual . can we increase the performance by some means ?? Yes we can verify the random number that may be one of the cause during weblogic startup .

Random Number Generation in Weblogic

The Generation of Random Number are done by using Math.random() or SecureRandom. The Source for generating the random numbers can be configured in such a way that they can depend on the Operating System. Java uses its own source for generating the Random numbers but for better random numbers, the source for generating the random numbers can assigned to the underlying operating System hardware Signals which are generated from the interactions from the network ,keyboard and other devices.

In RHEL, there are 2 files available that help in generating the Random numbers
/dev/random
&
/dev/urandom

The Random number generator uses hardware noises for generating the random numbers. The noise generated by the hardware is thus stored inside the entropy pool. The generator also has the information on how much bits of information is available in the entropy pool.

From using this entropy pool, the random numbers are generated.

The /dev/random will only return random date within the estimated number of bits of noise in the
entropy pool but one issue with this is the /dev/random will be blocked until additional noise is generated or bits available in the entropy pool. If no bits are available in the entropy pool, the /dev/random will be blocked.

The /dev/urandom will return as much data requested.

If your system does not have /dev/random and /dev/urandom created already, they can be created with the following commands:

           mknod -m 644 /dev/random c 1 8
           mknod -m 644 /dev/urandom c 1 9
           chown root:root /dev/random /dev/urandom

/dev/random is a blocking device and during times of low entropy (when there is not enough random bits left in it), /dev/random will block any processes reading from it (and hence hang) until more random bits have been generated.

The library used for random number generation in Sun’s JVM relies on /dev/random by default for Linux platforms. For configuring the random number generation with Weblogic,

Check if /dev/random works fine
head -n 1 /dev/random

If using Linux, you can use the /dev/urandom device instead. It does not block when it runs out of user-triggered data, instead it reuses the bits it has left.

If the command returns immediately, you can use /dev/random as the default generator for SUN’s JVM. If the command does not return immediately, use these steps to configure the JVM to use/dev/urandom .This can be configured as
-Djava.security.egd=file:/dev/./urandom and added to the Weblogic startup script or edit jre\lib\security\java.security so all the Weblogic use it Instead of modifying for each Weblogic service script .

The delay is caused by the depletion of the entropy pool provided by the OS. JAVA processes go to /dev/random and /dev/urandom for random data required for internal processes, usually related to security.

The difference between /dev/random and /dev/urandom

/dev/random – locks itself if the pool has no more available random data, so the calling process has to wait until the entropy pool is filled again

/dev/urandom – gets data from /dev/random as a sort of proxy, but when the pool is empty, it does not lock itself and it provides repeated data.
JAVA processes define the source for entropy data in the following file: jre\lib\security\java.security. The line in this file is:

securerandom.source=file:/dev/urandom

Once /dev/urandom is configured then try to start the Weblogic process then you can observe the startup is very faster and there is not hands or delay during startup .

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *