How could I reduce the Hybris server startup time?

2020-06-12 03:42发布

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 even just a little modification/misstype in the code. Is it possible to reduce this time by running only those extensions I have modified or any other way? That would be a great thing.

标签: hybris
11条回答
劫难
2楼-- · 2020-06-12 04:12

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.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2020-06-12 04:16

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.

查看更多
smile是对你的礼貌
4楼-- · 2020-06-12 04:17

So I have been using JRebel along with Hybris since past one year.

Although I have not been able to configure this with my IDE (I am sure there is a simple way), the usage is pretty straightforward.

After I have modified any java file or spring configuration, in a terminal different from the one I have my server running in, I navigate to the extension in which I have modified the files and then do an ant build. The modified files are picked up by the running server (you can see the new files/configuration being picked up in the server console).

Regarding the license, I use myJRebel license from https://my.jrebel.com/ which requires a social media login to obtain the license key.

Steps to Setup -

  1. Download the JRebel Library (standalone zip)
  2. Extract to your preferred location. Mine is C:\Monil\Tools\jrebel
  3. Add following to your local.properties (modify accordingly)

    tomcat.debugjavaoptions=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n -Xverify:none -agentpath:c:/Monil/Tools/jrebel/lib/jrebel64.dll -Xbootclasspath/p:${HYBRIS_TEMP_DIR}/hybris/rebelboot.jar

Please note that the ${HYBRIS_TEMP_DIR}/hybris/rebelboot.jar jar will automatically be added to hybris temp directly when you do a ant all and start your server.

查看更多
Fickle 薄情
5楼-- · 2020-06-12 04:21

you will find in this article all instructions to speed up your server startup time up to 50 % by

  1. disabling Cronjobs
  2. Removing unused tenants
  3. Modifing tomcat startStopThreads
  4. Excluding Some Jars From Scanning

https://hybrismart.com/2016/12/27/speed-up-server-start-time/

查看更多
姐就是有狂的资本
6楼-- · 2020-06-12 04:21

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
查看更多
不美不萌又怎样
7楼-- · 2020-06-12 04:24

I would recommend to use Jrebel - it works like a charm with Hybris, and redeploys beans in runtime. The main advantage is that it's able to reconfigure Spring beans without redeploying, so it really saves much time on server restart.

There are open-source alternatives, but they weren't suitable for me, though it's worth to look on them: DCEVM and fakereplace

查看更多
登录 后发表回答