当前位置: 首页 > 知识库问答 >
问题:

Liferay启动时间太长了

祁承望
2023-03-14

我是新的Liferay开发,我面临的麻烦与启动我的Liferay Tomcat服务器。它几乎需要3分钟(169048毫秒),这对于开发来说是不可接受的。我想把它压缩到一分钟左右。

以下是我的机器的规格:

  • 英特尔酷睿双核T2300@1.66 GHz
  • 4GB RAM(使用中3.24GB)
  • 带有Service Pack 1Windows 7 Enterprise 32位

我正在使用:

  • Liferay 6.1.1-Ce-GA2与Tomcat 7
  • Eclipse IDE Juno版本

为了加快进度,我:

  • 从Tomcat\webapps文件夹中删除了所有不必要的portlet。
  • 将Tomcat本机库1.1.24放入Tomcat\bin文件夹
  • 调整了我的portal-ext.properties,如下所示
     #disable some filters  
     com.liferay.portal.servlet.filters.sso.cas.CASFilter       = false
     com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter     = false
     com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter = false
     com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter= false
     com.liferay.portal.sharepoint.SharepointFilter             = false
     com.liferay.portal.servlet.filters.gzip.GZipFilter         = false

     #disable indexing  
     index.on.startup=false

这是我的启动日志:


    Jan 30, 2013 8:39:49 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: Loaded APR based Apache Tomcat Native library 1.1.24.
    Jan 30, 2013 8:39:49 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
    Jan 30, 2013 8:39:51 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-apr-8080"]
    Jan 30, 2013 8:39:51 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
    Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2620 ms
    Jan 30, 2013 8:39:51 AM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Jan 30, 2013 8:39:51 AM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
    Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\conf\Catalina\localhost\Hi-portlet.xml
    Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.HostConfig deployDescriptor
    WARNING: A docBase C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\Hi-portlet inside the host appBase has been specified, and will be ignored
    Jan 30, 2013 8:39:51 AM org.apache.catalina.startup.SetContextPropertiesRule begin
    WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Hi-portlet' did not find a matching property.
    Jan 30, 2013 8:39:52 AM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\conf\Catalina\localhost\ROOT.xml
    Loading jar:file:/C:/Liferay/portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
    Loading jar:file:/C:/Liferay/portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
    Loading file:/C:/Liferay/portal-6.1.1-ce-ga2/portal-ide.properties
    Loading file:/C:/Liferay/portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/portal-developer.properties
    Loading file:/C:/Liferay/portal-6.1.1-ce-ga2/portal-ext.properties
    Jan 30, 2013 8:39:59 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    08:40:16,321 INFO  [pool-2-thread-1][DialectDetector:71] Determine dialect for HSQL Database Engine 2
    08:40:16,330 WARN  [pool-2-thread-1][DialectDetector:86] Liferay is configured to use Hypersonic as its database. Do NOT use Hypersonic in production. Hypersonic is an embedded database useful for development and demo'ing purposes. The database settings can be changed in portal-ext.properties.
    08:40:16,484 INFO  [pool-2-thread-1][DialectDetector:136] Found dialect org.hibernate.dialect.HSQLDialect
    Starting Liferay Portal Community Edition 6.1.1 CE GA2 (Paton / Build 6101 / July 31, 2012)
    08:41:36,974 INFO  [pool-2-thread-1][BaseDB:452] Database supports case sensitive queries
    08:41:37,828 INFO  [pool-2-thread-1][ServerDetector:154] Server supports hot deploy
    08:41:37,850 INFO  [pool-2-thread-1][PluginPackageUtil:1030] Reading plugin package for the root context
    08:42:19,657 INFO  [pool-2-thread-1][AutoDeployDir:106] Auto deploy scanner started for C:\Liferay\portal-6.1.1-ce-ga2\deploy
    08:42:24,410 INFO  [pool-2-thread-1][HotDeployImpl:178] Deploying Hi-portlet from queue
    08:42:24,415 INFO  [pool-2-thread-1][PluginPackageUtil:1033] Reading plugin package for Hi-portlet
    Jan 30, 2013 8:42:24 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    Jan 30, 2013 8:42:30 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring FrameworkServlet 'Remoting Servlet'
    Jan 30, 2013 8:42:34 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\resources-importer-web
    08:42:35,522 INFO  [pool-2-thread-1][HotDeployImpl:178] Deploying resources-importer-web from queue
    08:42:35,523 INFO  [pool-2-thread-1][PluginPackageUtil:1033] Reading plugin package for resources-importer-web
    Jan 30, 2013 8:42:36 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    Jan 30, 2013 8:42:36 AM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\Liferay\portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\welcome-theme
    08:42:36,609 INFO  [pool-2-thread-1][HotDeployEvent:109] Plugin welcome-theme requires resources-importer-web
    08:42:37,305 INFO  [pool-2-thread-1][HotDeployImpl:178] Deploying welcome-theme from queue
    08:42:37,306 INFO  [pool-2-thread-1][PluginPackageUtil:1033] Reading plugin package for welcome-theme
    Jan 30, 2013 8:42:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    08:42:37,787 INFO  [pool-2-thread-1][ThemeHotDeployListener:87] Registering themes for welcome-theme
    08:42:39,764 INFO  [pool-2-thread-1][ThemeHotDeployListener:100] 1 theme for welcome-theme is available for use
    Jan 30, 2013 8:42:40 AM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-apr-8080"]
    08:42:40,167 INFO  [liferay/hot_deploy-1][HotDeployMessageListener:142] Group or layout set prototype already exists for company liferay.com
    Jan 30, 2013 8:42:40 AM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["ajp-apr-8009"]
    Jan 30, 2013 8:42:40 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 169048 ms

有什么建议吗?

共有1个答案

倪子晋
2023-03-14

评论已经给出了一些暗示。我想说,最重要的问题是检查是否使用了虚拟内存(分页)--一旦操作系统不得不将内存分页到磁盘上,您就输了:这可能是一个巨大的性能打击。

当您升级内存时(例如,如果您使用了虚拟内存),您可能要考虑将OS升级到64位OS-32bit只能处理4G,并且您可能会使用appserver内存达到极限,因为每个进程只能获得有限的内存。

您还可以在运行这么多其他应用程序之前测试Liferay是否启动得更快--这是您遇到内存问题的另一个暗示。

SSD选项将进一步加速您的系统,但价格远高于RAM。另外,在SSD上的虚拟内存并不是真的被推荐--它会更快地磨损驱动器。而不是在SSD上使用虚拟内存,而是不要使用虚拟内存--这样会更快更便宜。

 类似资料:
  • 我正在尝试在Windows上运行Kafka消息队列。 我在本教程中使用https://dzone.com/articles/running-apache-kafka-on-windows-os Kafka位置-C:\kafka2.11-1.1.0

  • 请注意,我说的不是部署时间,通过遵循另一个StackOverflow线程中的提示,可以减少一点部署时间。

  • 正如您所看到的,前两行之间有超过2分钟的间隔,这很可笑,尤其是考虑到这是一个非常小的应用程序。 在放弃自由配置文件之前,我可以做些什么来加快速度?

  • 关于Wildfly8.1.0中的应用程序部署,我遇到了一个奇怪的问题 在应用程序刚开始的时候,部署速度很快,但今天变得非常慢,我在服务器日志中看到,在org.hibernate.annotations.common.version和org.hibernate.dialct.dialion行之间花费了5分钟 也没有错误信息... 一旦启动,应用程序就会毫无问题地运行 我真的不知道该怎么办 我对应用程

  • 我正试图连接到mysql服务器,但这需要5秒钟。

  • 应用程序有一个JMS队列负责交付审计日志。应用程序将日志发送到JMS队列,该队列由MDB使用。 但是,发送的消息是大 XML 文件,大小从 20 MB 到 100 MB 不等。问题在于 JMS 队列使用消息的时间太长,从而导致内存不足错误。 我应该怎么做才能解决这个问题?