And just for reference, I've posted this but I'll ...
# docker
b
And just for reference, I've posted this but I'll post it again because it's fun to look at. This tests were using Lucee. Here's some numbers I ran for a client who was converting over to the CommandBox-based images with a bunch of possible options for their final images Basic docker file with no warm up • 788 Meg image size (This is only small-ish because it doesn't have any CF engine downloaded/installed) • 45 seconds from start to serving requests • Has external web hits to confirm latest versions of CF Engine, FR, etc and downloads CF Engine on every boot "Warmed up" CF Engine but not finalized • 1.2 Gig image size • 19 seconds from start to serving requests • Has external web hits to confirm latest versions of CF Engine, FR, etc on every boot Finalized single-stage build • 900 Meg image size • 9 seconds from start to serving requests • No external web hits and no downloading Finalized multi-stage build • 466 Meg image size • 9 seconds from start to serving requests • No external web hits and no downloading
s
what happens different in the Finalized single-stage build vs Finalized multi-stage build that reduces the build size?
b
I don't really know enough about docker to answer that, lol
But if you look at the readme for our docker images, it shows how to do the multi-stage
And I'm sure you can find a bunch of websites that explain it
s
oh ok ill have to explore
I dont do much with docker currently, i probably should to be part of the cool kids
s
either way, 9s startup is 🔥
🔥 1
b
Actually, it's even faster on a hello world app!
That app above was a huge Mach II, Transfer ORM, ColdSpring site my client had
My framework benchmarks docker image serves requests in about 3-4 seconds from issuing the docker start command
t
@bdw429s how are you testing undertow is up on the finalized builds? I have a container that needs to wait for startup and depending on state call a specific url to initialize the app
b
@thisOldDave the Docker healthcheck url, which is also the same url that initializes the app.
It's a heck of a lot simpler if it's all the same url because Docker just takes care of everything for you
t
now that's a good idea although I wouldnt want it fireing every 20 seconds 😉
b
@thisOldDave Don't make the warmup logic run every time the page is hit! just make it run if it hasn't run already. This is how a framework like COldBox works-- any page you hit loads the farmework if it's not already there. If it's there, then it just runs the page and is done. Stop thinking of your warmup script as a separate concern and just make it be a part of the framework coming online and the issue solves itself
Then you can hit your healthcheck/probe/whatever page as often as you like and it's purpose is two fold • load up stuff if it's not laoded • tell you whether the framework is online and operational
t
yup I did have my tongue firmly in my cheek but it is a good idea and will save a lot of messing about with bash
👍 1
b
For sure, and you really don't want your healtchheck passing prior to your warmup anyway because then Docker will be sending traffic to your container before you want it to