mardi 7 février 2017

Grails app is too slow to startup

Vote count: 0

I'm using grails 2.4.4 to develop a web application and Grails (using jetty plugin) is taking around 20 seconds to initialize and make the app available.

I would be okay with this fairly long time but it turns to 3 minutes for older hardware to start up the whole thing and I need it to be faster because once the server has started performance is good and not a concern.

Googling around found out in SO that jar scanning for servlet annotations could be the issue and disabled it for the classes in WEB-INF/lib and added this to the app context xml:

<Call name="setAttribute">
    <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
    <Arg>nothing.jar$</Arg>
</Call>

This helped cut down the time from 16s to 13s. Also tried building with servlet 2.5 configured instead of 3.0 to try to further improve this since annotation scanning is a servlet 3.0 feature but the speed up was minimal (around 1s).

My objective is to bring this time down to 6s since in the oldest hardware I have tested it took around 3 minutes so it is around 10 times slower and a 1 minute startup time would be somewhat tolerable.

Im a little lost on how to achieve this. Looking through the logs saw that context initialization is taking around 2000ms

2017-02-08 02:15:08,318 [main] INFO context.ContextLoader - Root WebApplicatio nContext: initialization completed in 2001 ms

Is there any posibility to speed this up?

asked 56 secs ago

Let's block ads! (Why?)



Grails app is too slow to startup

Aucun commentaire:

Enregistrer un commentaire