onStartup loaded slowly.
Closed this issue · 8 comments
Hi Pete,
I created a lambda function to test our framework code, but onStart even slowly. It always took more than 3000ms. Our lambda function memory is 2048MB.
Is there any way to improve cold start time?
Here is our logs:
"2018-12-06 04:48:16 <> INFO com.foundeo.fuseless.StreamLambdaHandler:43 - StreamLambdaHandler
initializing
2018-12-06 04:48:16 <> INFO com.amazonaws.serverless.proxy.internal.LambdaContainerHandler:97 - Starting Lambda Container Handler
2018-12-06 04:48:17 <> INFO com.foundeo.fuseless.StreamLambdaHandler:49 - StreamLambdaHandler onStartup
2018-12-06 04:48:20 <> INFO com.foundeo.fuseless.StreamLambdaHandler:104 - StreamLambdaHandler onStartup complete: 3216
START RequestId: 24ed50b5-f912-11e8-ba38-edde4f1a2657 Version: $LATEST
2018-12-06 04:48:20 <24ed50b5-f912-11e8-ba38-edde4f1a2657> DEBUG com.foundeo.fuseless.CFMLLambdaContainerHandler:99 - CFMLLambdaContainerHandler handleRequest: /
Framework serverless:
Application vars loaded!!!!!
Request id: 24ed50b5-f912-11e8-ba38-edde4f1a2657
Inclued dump file
Error call encodeForHTML .."
Thanks
Hmm - I think ESAPI is loaded as a bundle, which may not be included in lucee-light so that is why your encodeForHTML call might be failing.
Pete, ah i meant the loaded time slowly onStart event. with my jar size ~21MB, it always take at least 3500ms to finish onStart.
For sample above log, it took 3216ms.
Hi Pete,
For ESAPI extension, i added jar file org.lucee.esapi-2.1.0.1.jar AND spec LUCEE_EXTENSIONS_INSTALL env = true but it doesn't work. can you guide me the way to load that ext?
Thanks
Yeah I think the extensions need to be placed in the bundles directory on lucee, so I'll need to make a way to support that.
Hi Pete,
Any news on the extensions loaded for Lucee. is it fast to implement? otherwise we will change to use java call directly i think. Thanks
@MilestoneTech - haven't had a chance to look into this yet... I haven't tested this, but one workaround may be to unzip your lucee.jar and add the bundle(s) you want into the bundles directory, then zip it back up into a jar.
As for the slow startup times, part of this is also due to initial CFML compilation if you have a large codebase it will have to compile a lot of CFML code into java bytecode on the first request, which takes a bit of time.
@MilestoneTech did adding the bundle jar manually work for you?
@pfreitag I tried to add bundle jars:
org.apache.commons.image-1.0.0.R1534292.jar
org.lucee.esapi-2.1.0.1.jar
but it doesn't work. so we was on hold it for now. in the future we should combine CFM to class before upload to lambda to reduce cold start time.