4 ms·
I've been using Docker since 2015ish and the container start up / stop speed is really the only thing that bugs me. Everything else is fine for day to day usag
by nickjj 7y ago
I've been using Docker since 2015ish and the container start up / stop speed is really the only thing that bugs me.
Everything else is fine for day to day usage IMO (on Windows and Linux at least) and very much worth the trade offs, but having to wait multiple seconds for your app to start is tedious since it plays such a heavy role in both development and even in production. Each second your app is not running is downtime, assuming you're not load balanced.
I opened an issue for this almost a year ago but not too much has come from it other than identifying there was maybe a regression in recent'ish versions: https://github.com/moby/moby/issues/38077 https://github.com/moby/moby/issues/38077
We're talking multiple seconds in Docker vs ~150ms as a regular process to start up a typical web app process like gunicorn in a decently sized Flask app (many thousands of lines of code, lots of dependencies -- a real world app).
- croo 7y agoFew seconds are my dream coming true. Try working on an application where every deploy is a coffee break... :(
- xorcist 7y agoStarting the process probably isn't what's taking so long though.
- oblio 7y agoYou'd be surprised. Big Java enterprise apps deployed to Tomcat or God-forbid! IBM/Oracle app servers can take 2-3-5 minutes just to be fully operational. I've had deployment health checkers timeout after 2 minutes because the servers just wouldn't be up. It seems insane, but that's how life looks for thousands of developers.
- nickjj 7y ago> It seems insane, but that's how life looks for thousands of developers. True, but there's tens of thousands of developers not using big Java enterprise apps where having Docker add 4-5-6+ seconds of startup time has a huge negative impact. gunicorn (Python) apps tend to start in hundreds of milliseconds (even pretty big ones). puma (Ruby) apps tend to start in seconds or tens of seconds (it can get higher for massive apps). cowboy (Elixir) apps tend to start in low seconds (this includes booting up the BEAM VM). Just the above 3 examples cover the Flask, Django, Rails and Phoenix ecosystem. That's a lot of developers.
- oblio 7y agoI've been part of Ruby teams and Rails apps can start almost as slow as Java apps. Big .NET projects, too. Plus there's probably 10x more Java developers than Ruby developers out there. And Elixir/Phoenix devs are probably 0.001% of Java devs :-)
- nickjj 7y agoIt depends on how big the Rails app is. One app I work with has 40 top level gems and about 17,000 lines of Ruby code (which goes a longs ways in Rails). It's not "big big" but it's not tiny. It takes under 10s to boot up. I'm sure if you have a Shopify-tier app it takes much longer, but a majority of apps aren't at that scale. I was just throwing out examples and I'm just trying to say not everyone is dealing with cases where Docker's added 2-5+ seconds isn't a big deal. For a Flask app those few seconds make it ~20-50x longer to start up due to Docker and for a majority of other frameworks / average app sizes, it's a non-ignorable amount.
- StreamBright 7y agoFirecrackers are fixing that. https://firecracker-microvm.github.io https://firecracker-microvm.github.io
- james_s_tayler 7y agoI take it you've never worked in an enterprise Java shop with a few million line legacy code base deployed to whatever the hell webserver I can't remember the name of right now. Seconds is great in comparison. Minutes, not so much.
- cs02rm0 7y agoJBoss, Websphere? I know that pain, hadn't even occurred to me that anyone would think containers had a slow startup time. Especially as they've often replaced VMs for me.
- james_s_tayler 7y agoWebLogic.
- tuananh 7y agothis name brings back lots of painful memory back in the day.
- TheWizardofOdds 7y agoThe long startup time is somehow what keeps me from really liking Docker. In the end (if I understood correctly), it is supposed to be the go-to tool for serverless architecture. If my serverless function needs more then a second to startup, it's not usable for me. Even the hello-world container, which is only a few kB in size needs roughly a second to startup.
- utopian3 7y ago> In the end (if I understood correctly), it is supposed to be the go-to tool for serverless architecture. You misunderstood. No one calls Docker a “serverless” architecture.
- TheWizardofOdds 7y agoAnd i didn't either, I called it a tool for serverless architecture. In fact some tools for serverless architecture like AWS Fargate require you to use Docker.
- VonGallifrey 7y agoI know that AWS Fargate has the tagline of "Run containers without managing servers or clusters", but that is not what "serverless architecture" means. Fargate is a container service. Serverless would be, for example, AWS Lambda, Azure Functions or Google Cloud Functions.
- onefuncman 7y agoFargate is serverless because the compute is abstracted away completely. A lambda runtime is just a specialized container and they've added similar customizability to it lately with Layers/Runtime configuration.
- VonGallifrey 7y agoI know that the definitions of these kinds of buzzwords can be fuzzy sometimes, but I have never heard a definition of serverless that would include Fargate. Here is what Cloudflare uses to describe serverless: > Serverless computing is a method of providing backend services on an as-used basis. Servers are still used, but a company that gets backend services from a serverless vendor is charged based on usage, not a fixed amount of bandwidth or number of servers. With Fargate you still get charged for your running instances your containers are running on. Even if the containers themselves are idle. This is a container service and not a serverless architecture.
- hbt 7y ago- start the container with docker run and run sleep 999 - then start your application with docker exec you will have instant execution. Only restart your container if the environment changes (new build etc.) For development, mount your source code in readonly.