Weblogic starts slow

I had a lot of troubles starting Oracle Weblogic 10.3g under linux (CentOS 5.2). It took anywhere between 5 to 20 minutes from the time I ran startup script to the point when Weblogic actually started. Here is typical log:

<Mar 12, 2009 12:35:34 PM EDT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3  Fri Jul 25 16:30:05 EDT 2008 1137967 >
<Mar 12, 2009 12:46:37 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>

Turns out Weblogic uses random number generator during start up. Because of the bug in java it reads ‘randomness’ from /dev/random. /dev/random is very good random numbers generators but it is extremely slow. It takes sometimes 10 minutes or more to generate one number. /dev/urandom is not that good, but it is instant.
Java somehow maps /dev/urandom file to /dev/random. That’s why default settings in $JAVA_HOME/jre/lib/security/java.security are useless.

Possible solutions:
1) Add  “-Djava.security.egd=file:/dev/./urandom” (/dev/urandom does not work) to java parameters.

Worse but working solution is:
2) mv /dev/random /dev/random.ORIG ; ln /dev/urandom /dev/random

3) Best solution is to change $JAVA_HOME/jre/lib/security/java.security
Replace securerandom.source with

securerandom.source=file:/dev/./urandom

This problem does not happen under windows because it uses different implementation of /dev/random.

It takes seconds to start weblogic server now.

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

25 Responses to Weblogic starts slow

  1. Mark says:

    We have been working with bea to resolve this issue for most of a year. Your accurate explanation and solution solved it. Much appreciated.

  2. larry says:

    It works like magic!

    Thanks so much for blogging this!

  3. Marc says:

    +100 kuddos! Every vendor should mention this turbo boost option.

    Marc

  4. Dina says:

    Thank You very much. It helped a lot!

  5. wim says:

    Starting WebLogic NodeManager now takes 2 seconds instead of 5 minutes, thanks to your solution!
    Great job!

  6. Anoop says:

    You have saved my life, really great, no words to explain, Thank you very much. Keep blogging.

  7. Pingback: Weblogic SOA Perfomance boost | SOA Governance - Service Oriented Architecture - SOA Business - SOA Design - SOA Services - SOA Software - SOA Solutions - SOA Security - SOA Web Service

  8. jonnio says:

    Nice!

    BUT, why? What is wrong with the random number generator on Linux? I’d like to understand why securerandom.source=file:/dev/./urandom works where securerandom.source=file:/dev/urandom doesn’t.

    Any ideas?

  9. admin says:

    My guess it a bug in file names parser.

  10. saleem says:

    This method just doesn’t work really so well in solaris. I tried all that has been mentioned here and its all in vain, no use folks, really. Any suggestion in solaris. thanks

  11. Pingback: Good Post on WLS 10.3 Start Up « Head in the Web™

  12. Stephan Knabe says:

    Thanks for that tip. The Point (in /dev/./urandom/) is the point.

  13. Hemanth says:

    Thanks for the nice tip

  14. anthonychen says:

    Thanks a lot! Now the server start-up takes from 8 mins to 8 seconds!

  15. altern says:

    Thanks a lot. I tried to beat this issue for more than a week without any success. Your tip finally made possible for my team to move forward.

  16. Sean says:

    Issue should be addressed via java bug fix 6998583. Available in 6u25.

  17. kal says:

    Thank you so much..It helped !!!

  18. Marco says:

    Finaly ! been strugling with this about a year.
    Thumbs up for you

  19. Martin Rogers says:

    This is fantastic, really helped us out. But how on earth did you find it? We have been looking at our weblogic process with strace and netstat searching for our root cause with no luck at all…

  20. Lon says:

    Thank You!!!! We have a bunch of WebLogic servers that are running fine. I recently installed a new environment and was plagued by this problem until now. I’m running Java 6u26 on RedHat ES 6.1 and WebLogic 10.3.5.

    Thanks again!

  21. anfel says:

    THANKS THANKS!! SOO MUCH!

  22. ajay says:

    I am a Websphere admin. Was trying to install WLS1035 with jrockit-jdk1.6.0_29 and was stuck with slow domain creation and slow admin console.
    Your clue helped me to overcome the crazy slowness.
    Great info. Thanks

  23. St33v0 says:

    I was stuck with WLST, trying to connect to an SSL administration port.
    The error message was unclear (no server is running on t3s://ip:port – whereas the port is open).
    This post both solved the problem by reducing the response time of the Admin Server (from several minutes to a few seconds, WLST timeout is ~30 seconds) and dramatically reduced the WebLogic servers startup time (from 6 minutes to 40 seconds).

    Thanks a lot for your post niteartadmin, it helped me twice !

    My conf is : RHEL 6.1, JDK Sun 1.6u27, WebLogic 10.3.3.

  24. fisker says:

    this is so great, thx dude! :-)

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>