加快Weblogic Server启动时间

时间:2021-08-05 02:45:07

At my work, we use Weblogic Server to host an enterprise portal. Which is fine.

在我的工作中,我们使用Weblogic Server来托管企业门户。哪个好。

However, I've recently had the opportunity to use Tomcat for some side projects, and I am struck by the incredible difference in speed. Tomcat takes 3-5 seconds to start up, and 10-15 seconds to deploy a medium-sized projects. Wewblogic takes 3-5 minutes to start, and up to 10 minutes to deploy. This kills any iterative development.

但是,我最近有机会使用Tomcat进行一些项目,我对速度的惊人差异感到震惊。 Tomcat启动需要3-5秒,部署中型项目需要10-15秒。 Wewblogic启动需要3-5分钟,部署最多需要10分钟。这会杀死任何迭代开发。

Am I going to have to resign myself to its being slow and bloated, or is there anything I can do to speed it up? Anyone have experience with this?

我是否不得不让自己放慢速度和臃肿,或者我能做些什么来加快速度?有人有这方面的经验吗?

8 个解决方案

#1


You will not be able to turn the frog into a princess. I would wonder slightly about those startup times for weblogic - they seem a bit excessive, you're not running on linux by any chance ?

你将无法将青蛙变成公主。我会想知道weblogic的启动时间 - 它们看起来有点过分,你是不是有机会在linux上运行?

If you're running nested archives (wars within ears etc) and also directory-scanning technologies (hibernate, spring etc), you may try unpacking it all to the corresponding exploded structure before deploying; it has been known to help a bit.

如果您正在运行嵌套档案(耳朵内的战争等)以及目录扫描技术(休眠,弹簧等),您可以尝试在部署之前将其全部解压缩到相应的爆炸结构;它已经知道有点帮助。

Tomcat contains a very small subset of the features weblogic has. We develop on jetty but deploy on weblogic for acceptance/production environments and this works fairly well. You can do the same with tomcat.

Tomcat包含weblogic所具有的一小部分功能。我们在jetty上开发,但在weblogic上部署接受/生产环境,这非常有效。你可以用tomcat做同样的事情。

Tomcat is a fairly strict container whilst weblogic is lenient, so you'll normally have only minor troubles deploying to weblogic, especially as long as you continuously do both.

Tomcat是一个相当严格的容器,而weblogic是宽松的,所以你通常只有很小的麻烦部署到weblogic,特别是只要你连续两个都做。

You can also use a tool like javarebel to do really nifty hot-deployment and avoid all those restarts.

您还可以使用像javarebel这样的工具来进行非常漂亮的热部署并避免所有这些重新启动。

#2


As krosenvold said, the random number generation can cause slow startup.

正如krosenvold所说,随机数生成会导致启动缓慢。

The recommendation from Oracle is to use one of the -D flags below - only on non-production systems since it lessen security.

Oracle的建议是使用下面的-D标志之一 - 仅在非生产系统上,因为它会降低安全性。

Use -Djava.security.egd=file:///dev/urandom switch or file:/dev/./urandom to the command that starts weblogic.

使用-Djava.security.egd = file:/// dev / urandom switch或file:/ dev /./ urandom到启动weblogic的命令。

The information above is taken from http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14772/weblogic_server_issues.htm#CIHIIBGJ

以上信息来自http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14772/weblogic_server_issues.htm#CIHIIBGJ

If the -D flag doesn't work, look at the following solution: http://www.itonguard.com/20090313/weblogic-starts-slow/

如果-D标志不起作用,请查看以下解决方案:http://www.itonguard.com/20090313/weblogic-starts-slow/

#3


You haven’t mentioned what level and what platform but the WebLogic Server Performance and Tuning guide contains a number of hints and tips that may help you.

您没有提到什么级别和什么平台,但WebLogic Server性能和调优指南包含许多可能对您有所帮助的提示和技巧。

#4


WebLogic can also be slow to start up on Linux if it's connecting to a database and you haven't set up DNS properly.

如果WebLogic连接到数据库并且您没有正确设置DNS,那么在Linux上启动它也会很慢。

Depending on your setup, you might be able to edit /etc/resolv.conf and comment out the nameserver line. This can reduce WebLogic's startup time from 20 minutes to less than a minute.

根据您的设置,您可以编辑/etc/resolv.conf并注释掉nameserver行。这可以将WebLogic的启动时间从20分钟缩短到不到1分钟。

#5


If you use Weblogic workshop, then you just need to publish, not restart the application server while doing iterative development.

如果您使用Weblogic研讨会,那么您只需要在进行迭代开发时发布,而不是重新启动应用程序服务器。

#6


On the memory consumption issue, you might want to try setting the memory parameters of the JVM used by your WebLogic server. Log in to your WL Web Admin Console and go to Environment/Servers/[your server]/Configuration/Server Start and, on the "Arguments", setting something like -Xms256m -Xmx256m will set your JVM's initial (Xms) and maximum (Xmx) heap size to 256 megabytes. You will want to play around with these numbers and find the best values for your environment. But please be aware that your Eclipse instance might be consuming a lot of memory as well.

在内存消耗问题上,您可能希望尝试设置WebLogic服务器使用的JVM的内存参数。登录到您的WL Web管理控制台并转到环境/服务器/ [您的服务器] /配置/服务器启动,在“参数”上,设置类似-Xms256m -Xmx256m的设置将设置您的JVM的初始(Xms)和最大值( Xmx)堆大小为256兆字节。您将想要使用这些数字并找到适合您环境的最佳值。但请注意,您的Eclipse实例可能也会占用大量内存。

Regarding the startup time, although a bit larger than I would expect, they seem OK. This problem is very frequent, and I don't think you will be able to definitely solve it. WebLogic has much more features than Tomcat, and this reflects in other characteristics of the environment (like startup time).

关于启动时间,虽然比我预期的要大一点,但看起来还不错。这个问题非常频繁,我认为你无法解决它。 WebLogic具有比Tomcat更多的功能,这反映了环境的其他特征(如启动时间)。

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.

原来,Weblogic在启动时使用随机数生成器。由于java中的错误,它从/ dev / random读取“randomness”。 / dev / random是非常好的随机数生成器,但它非常慢。生成一个数字有时需要10分钟或更长时间。 / dev / urandom不是那么好,但它是即时的。 Java以某种方式将/ dev / urandom文件映射到/ dev / random。这就是为什么$ JAVA_HOME / jre / lib / security / java.security中的默认设置无用的原因。

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

可能的解决方案:1)将“-Djava.security.egd = file:/ dev /./ urandom”(/ dev / urandom不起作用)添加到java参数。

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

更糟糕的是,工作解决方案是: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

3)最佳解决方案是更改$ JAVA_HOME / jre / lib / security / java.security替换securerandom.source

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

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

在Windows下不会发生此问题,因为它使用/ dev / random的不同实现。

It takes seconds to start weblogic server now.

现在启动weblogic服务器需要几秒钟。

#7


Please check that the lengthy startup time is actually due to WebLogic Server startup and not WebLogic Portal startup time.

请检查漫长的启动时间是否实际上是由于WebLogic Server启动而不是WebLogic Portal启动时间。

#8


As Tomas F and krosenvold suggested it may be for the random number generator.

正如Tomas F和krosenvold建议的那样,它可能是随机数生成器。

On the standard startup of Weblogic 12.2.1 I got this message :

在Weblogic 12.2.1的标准启动时,我收到了以下消息:

Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. 
To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true

So I specified it and it cut the startup time in half. About 13 seconds on a clean domain.

所以我指定了它,它将启动时间缩短了一半。在一个干净的域上大约13秒。

#1


You will not be able to turn the frog into a princess. I would wonder slightly about those startup times for weblogic - they seem a bit excessive, you're not running on linux by any chance ?

你将无法将青蛙变成公主。我会想知道weblogic的启动时间 - 它们看起来有点过分,你是不是有机会在linux上运行?

If you're running nested archives (wars within ears etc) and also directory-scanning technologies (hibernate, spring etc), you may try unpacking it all to the corresponding exploded structure before deploying; it has been known to help a bit.

如果您正在运行嵌套档案(耳朵内的战争等)以及目录扫描技术(休眠,弹簧等),您可以尝试在部署之前将其全部解压缩到相应的爆炸结构;它已经知道有点帮助。

Tomcat contains a very small subset of the features weblogic has. We develop on jetty but deploy on weblogic for acceptance/production environments and this works fairly well. You can do the same with tomcat.

Tomcat包含weblogic所具有的一小部分功能。我们在jetty上开发,但在weblogic上部署接受/生产环境,这非常有效。你可以用tomcat做同样的事情。

Tomcat is a fairly strict container whilst weblogic is lenient, so you'll normally have only minor troubles deploying to weblogic, especially as long as you continuously do both.

Tomcat是一个相当严格的容器,而weblogic是宽松的,所以你通常只有很小的麻烦部署到weblogic,特别是只要你连续两个都做。

You can also use a tool like javarebel to do really nifty hot-deployment and avoid all those restarts.

您还可以使用像javarebel这样的工具来进行非常漂亮的热部署并避免所有这些重新启动。

#2


As krosenvold said, the random number generation can cause slow startup.

正如krosenvold所说,随机数生成会导致启动缓慢。

The recommendation from Oracle is to use one of the -D flags below - only on non-production systems since it lessen security.

Oracle的建议是使用下面的-D标志之一 - 仅在非生产系统上,因为它会降低安全性。

Use -Djava.security.egd=file:///dev/urandom switch or file:/dev/./urandom to the command that starts weblogic.

使用-Djava.security.egd = file:/// dev / urandom switch或file:/ dev /./ urandom到启动weblogic的命令。

The information above is taken from http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14772/weblogic_server_issues.htm#CIHIIBGJ

以上信息来自http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14772/weblogic_server_issues.htm#CIHIIBGJ

If the -D flag doesn't work, look at the following solution: http://www.itonguard.com/20090313/weblogic-starts-slow/

如果-D标志不起作用,请查看以下解决方案:http://www.itonguard.com/20090313/weblogic-starts-slow/

#3


You haven’t mentioned what level and what platform but the WebLogic Server Performance and Tuning guide contains a number of hints and tips that may help you.

您没有提到什么级别和什么平台,但WebLogic Server性能和调优指南包含许多可能对您有所帮助的提示和技巧。

#4


WebLogic can also be slow to start up on Linux if it's connecting to a database and you haven't set up DNS properly.

如果WebLogic连接到数据库并且您没有正确设置DNS,那么在Linux上启动它也会很慢。

Depending on your setup, you might be able to edit /etc/resolv.conf and comment out the nameserver line. This can reduce WebLogic's startup time from 20 minutes to less than a minute.

根据您的设置,您可以编辑/etc/resolv.conf并注释掉nameserver行。这可以将WebLogic的启动时间从20分钟缩短到不到1分钟。

#5


If you use Weblogic workshop, then you just need to publish, not restart the application server while doing iterative development.

如果您使用Weblogic研讨会,那么您只需要在进行迭代开发时发布,而不是重新启动应用程序服务器。

#6


On the memory consumption issue, you might want to try setting the memory parameters of the JVM used by your WebLogic server. Log in to your WL Web Admin Console and go to Environment/Servers/[your server]/Configuration/Server Start and, on the "Arguments", setting something like -Xms256m -Xmx256m will set your JVM's initial (Xms) and maximum (Xmx) heap size to 256 megabytes. You will want to play around with these numbers and find the best values for your environment. But please be aware that your Eclipse instance might be consuming a lot of memory as well.

在内存消耗问题上,您可能希望尝试设置WebLogic服务器使用的JVM的内存参数。登录到您的WL Web管理控制台并转到环境/服务器/ [您的服务器] /配置/服务器启动,在“参数”上,设置类似-Xms256m -Xmx256m的设置将设置您的JVM的初始(Xms)和最大值( Xmx)堆大小为256兆字节。您将想要使用这些数字并找到适合您环境的最佳值。但请注意,您的Eclipse实例可能也会占用大量内存。

Regarding the startup time, although a bit larger than I would expect, they seem OK. This problem is very frequent, and I don't think you will be able to definitely solve it. WebLogic has much more features than Tomcat, and this reflects in other characteristics of the environment (like startup time).

关于启动时间,虽然比我预期的要大一点,但看起来还不错。这个问题非常频繁,我认为你无法解决它。 WebLogic具有比Tomcat更多的功能,这反映了环境的其他特征(如启动时间)。

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.

原来,Weblogic在启动时使用随机数生成器。由于java中的错误,它从/ dev / random读取“randomness”。 / dev / random是非常好的随机数生成器,但它非常慢。生成一个数字有时需要10分钟或更长时间。 / dev / urandom不是那么好,但它是即时的。 Java以某种方式将/ dev / urandom文件映射到/ dev / random。这就是为什么$ JAVA_HOME / jre / lib / security / java.security中的默认设置无用的原因。

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

可能的解决方案:1)将“-Djava.security.egd = file:/ dev /./ urandom”(/ dev / urandom不起作用)添加到java参数。

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

更糟糕的是,工作解决方案是: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

3)最佳解决方案是更改$ JAVA_HOME / jre / lib / security / java.security替换securerandom.source

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

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

在Windows下不会发生此问题,因为它使用/ dev / random的不同实现。

It takes seconds to start weblogic server now.

现在启动weblogic服务器需要几秒钟。

#7


Please check that the lengthy startup time is actually due to WebLogic Server startup and not WebLogic Portal startup time.

请检查漫长的启动时间是否实际上是由于WebLogic Server启动而不是WebLogic Portal启动时间。

#8


As Tomas F and krosenvold suggested it may be for the random number generator.

正如Tomas F和krosenvold建议的那样,它可能是随机数生成器。

On the standard startup of Weblogic 12.2.1 I got this message :

在Weblogic 12.2.1的标准启动时,我收到了以下消息:

Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. 
To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true

So I specified it and it cut the startup time in half. About 13 seconds on a clean domain.

所以我指定了它,它将启动时间缩短了一半。在一个干净的域上大约13秒。