Closed vladholubiev closed 1 month ago
keen on speed up cold start, +1
@vladgolubev - can you please post some example code that we can add to our own Dockerfile's to do this smoke start?
I tried this:
RUN touch /tmp/test.txt
RUN cd /tmp \
&& libreoffice7.3 --headless --invisible --nodefault --view --nolockcheck --nologo --norestore \
--convert-to pdf --outdir /tmp /tmp/test.txt
RUN rm /tmp/test.*
Which runs correctly, but I still occasionally (very seldom) get the long ~20-30s startup times, where the majority of the time is attributed to the "duration", not the "init duration".
I've only received these startup times the first time I run the lambda after a code update Now it seems like it occurred for a lambda that not had been executed for a couple of days.
I can't say I see a difference with the code I posted above.
Hi @vladgolubev - any updates on this issue?
Have been trying different approaches here, but still no success in reducing the cold start time.
Would be happy to create a PR if I can get a bit more info :)
@patrikmolsson I've just pushed the potential fix. For me, it improved cold start locally by >1s
Curious, that is basically what I had... Have you tested this on AWS as well?
I'll give this a shot anyways! Thanks for the update.
Another note: Don't you need to have the ENV variable set prior to your run? I.e. put ENV HOME=/tmp
above your RUN touch ...
?
Don't you need to have the ENV variable set prior to your run? I.e. put ENV HOME=/tmp above your RUN touch
Good catch! Thanks! I've just pushed such change!
I haven't gotten around to testing on AWS just yet.
Empirically found, that a cold start could be reduced from ~30s to ~5s if we smoke start LO during the Docker image build time so it can pre-create some bootstrap files that it does create during the first start.