How could I reduce the Hybris server startup time?

前端 未结 11 1869
花落未央
花落未央 2021-02-14 15:08

I am working on a Hybris project and it is very time consuming to wait 350 - 550 sec for a single Hybris server startup, for e

相关标签:
11条回答
  • 2021-02-14 15:11

    I saw lot of comments for people are not able to setup any open source alternative to Jrebels.

    Hybris server startup time can't be drastically reduced, specially on windows where it takes around 20 to 30 minutes(if you also have some custom extension build over using the standard extensions).

    The only good solution is to use JRebels but the downside of JRebel is that it is too expensive. Good alternative to JRebel is DCEVM + HotSwap. Here are the Steps to setup HotSwap.

    What actually JRebel or HotSwap does? It loads the code changes in the live running server. You don't need to restart your server again for each code change.

    Please let me know in case you face any kind of issues in setting up the same.

    0 讨论(0)
  • 2021-02-14 15:13

    +1 on JRebel. It works well with hybris. Sure, it's expensive, but you'll rapidly get the ROI savings. The initial load is slower, but once it's up it'll save a lot of time.

    The other thing to do is to take a look at your localextensions.xml and ensure only the extensions you need for your project are in there. It makes a big difference to the start up time.

    I've also seen reasonable start up time improvements through using a DB other than HSQL when running the platform. I use MySQL locally.

    The other thing is to ensure you've got enough grunt in the machine you're using. I've just started the platform here and even with JRebel running it's 'only' taken 200 seconds. I'd suggest looking at a quad core CPU and an SSD to improve times for local development.

    0 讨论(0)
  • 2021-02-14 15:19

    Please use this properties in local.properties file

    #Performance mode
    build.development.mode=false
    tomcat.development.mode=false
    storefront.granule.enabled=true
    addonfilter.active=false
    
    0 讨论(0)
  • 2021-02-14 15:20

    You would also like to check https://wiki.hybris.com/display/partnerblog/2013/09/23/Avoid+restarting+the+server+as+much+as+possible . Although, this is not a direct answer to your question, it states how to avoid server restart.

    0 讨论(0)
  • 2021-02-14 15:20

    Try to put only required extension in localextension.xml.
    You can stop Solr server from autostarting by disabling it through local.properties file.
    And if you are running hybris server on intel-i3/AMD processor,please upgrade to intel-i5 with minimum of 8 GB RAM.

    0 讨论(0)
  • 2021-02-14 15:21

    Thanks to all of you, who wrote an answer! :) Actually I found a really great solution for my own question:

    • I modified the context.xml in the platform/tomcat/conf folder to be reloadable and to watch the WEB-INF folder
    • I use IntelliJ to do the developing stuff, and it has an option to compile things, like a single java file or a whole package/module/extension. So I modified the compilation path to the WEB-INF/classes and that's all.

    Now if I start a hybris server and I modify (or create) a file in my project, I just run a compile on the modified package or just on the single current file and after a few seconds Tomcat reloads the modified stuff in the current extension.

    UPDATE: Since a Hybris extension could not use the "webapp" part of other extensions, it seems like it is not possible to reload any dependency. So my solution is working only on "webapp only" extensions.

    0 讨论(0)
提交回复
热议问题