Liferay启动花费的时间太长 [英] Liferay startup takes way too long

查看:82
本文介绍了Liferay启动花费的时间太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Liferay开发的新手,并且在启动Liferay Tomcat服务器时遇到了麻烦.它花费了将近3分钟(169048毫秒),这对于开发来说是无法接受的.我想把时间降到一分钟左右.

I'm new to Liferay developing and I’m facing troubles with the startup of my Liferay Tomcat server. It takes almost 3 minutes (169048 ms) which is unacceptable for development. I’d like to get it down to about one minute.

这是我的机器的规格:

  • Intel Core Duo T2300 @ 1.66GHz
  • 4GB RAM(正在使用3.24GB)
  • 带有Service Pack 1的Windows 7 Enterprise 32位

我正在使用:

  • 与Tomcat 7捆绑在一起的Liferay 6.1.1-ce-ga2
  • Eclipse IDE Juno版本

为了加快速度,我已经:

In order to speed things up, I’ve:

  • 从tomcat \ webapps文件夹中删除了所有不必要的portlet.
  • 在tomcat \ bin文件夹中放入Tomcat本机库1.1.24
  • 如下所示调整了我的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

有什么建议吗?

推荐答案

注释已经给出了一些提示.我要说的是,最重要的问题是检查是否使用了虚拟内存(分页)-操作系统必须将内存分页到磁盘时,您就已经迷失了:性能可能受到巨大打击.

The comments already gave some hints. I'd say, the most important issue is to check if virtual memory (paging) is used - as soon as the OS has to page memory to disk, you have lost: There's a potentially huge performance hit.

在升级内存(例如,如果您访问虚拟内存)时,您可能要考虑将操作系统升级到64位操作系统-32位只能寻址4G,并且由于每个进程只能获得一个内存,因此您可能会遇到appserver内存的限制.内存量有限.

When you upgrade your memory (e.g. if you hit the virtual memory) you might want to consider upgrading the OS to a 64bit OS - 32bit can only address 4G and you might hit limits with appserver memory as each process can only get a limited amount of memory.

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

You could also test if Liferay starts up faster before you run so many other applications - this is another hint that you're running into a memory issue.

SSD选项将进一步加速您的系统,但价格要比RAM高得多.此外,实际上也不建议使用SSD上的虚拟内存-它将使驱动器更快地磨损.而且,不要在SSD上使用虚拟内存,而是不要使用虚拟内存-这将更快,更便宜.

The SSD option will further accelerate your system, but for a much higher price than RAM. Also, virtual memory on SSD is not really recommended - it will wear out the drive quicker. And instead of using virtual memory on SSD, rather don't use virtual memory - this will be quicker AND cheaper.

这篇关于Liferay启动花费的时间太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆