5 ms·
Setting up containers is ridiculously fast compared to VMs.
by sumedh 9y ago
Setting up containers is ridiculously fast compared to VMs.
- stephenr 9y agoWhat do you mean by "setting up". Are you talking about the work to provision a working target environment (i.e. what the VM/Container runs) or are you talking about the literal time for the environment to start?
- viraptor 9y agoContainers help with both. No full-system boot delay helps. Cached layers help. Not dealing with vm-specific kernel modules helps. Fast non-nfs volumes shared with the host help. There are speed benefits for containers all over the place - both in time spent dealing with the environment and in actual execution.
- stephenr 9y ago> No full-system boot delay helps I just cold-booted a Vagrant VM, which is configured to check for new base-box versions (i.e. a network delay that can be disabled). time vagrant up ... real 0m39.698s user 0m11.989s sys 0m5.490s If your argument about tooling is around performance and the "slow" one takes just 40 seconds to start, I think you need to clarify how often you expect to be starting this tool in a day. > Cached layers help. Helps what, exactly? > Not dealing with vm-specific kernel modules helps. I don't even know what you're talking about here. Do you mean you need to have a hypervisor kernel module? What exactly do you need to "deal with"? > Fast non-nfs volumes shared with the host help. I've never once used an NFS volume in a Vagrant guest. In case you weren't aware, Vagrant is not limited to using VirtualBox. > There are speed benefits for containers all over the place - both in time spent dealing with the environment and in actual execution. You haven't actually identify any environment issues you need to "deal with", just said "X helps".
- viraptor 9y agoSome context then. The happy path startup cost (environment is already prepared) matters to devs who never deal with the environment itself. If you're dealing with frontend only - maybe that's you most of the time, and you only see the 40s maybe once a day. But there are other costs. Someone deals with updates, with adding new functionality, with debugging issues. I spend most of my day recently waiting for puppet runs in vagrant/vbox. It's 10+ min for a full run. Then I make more changes - sometimes an incremental provision is enough, sometimes I need a full rebuild. On the other hand, if the environment was built with docker layers, I'd have much less waiting to do, because the caching of partial build/layer is integrated. Over a whole day, that's not insignificant time saving. And sure, vagrant has multiple backend. I'm using vbox, and so does almost every developer using vagrant. It's the only free one. (Apart from the docker backend)
- stephenr 9y agoThat is literally what the concept of base boxes is for. Build your own base box with whatever prerequisites you have baked in. It's still a 10 minute puppet run if that's how long your provisioning takes, but that happens once, and then you distribute the box. While you can just use a base distro box, for large/complex setups it's not always the best approach.
- sumedh 9y agoHow long does it take to setup postgres 9.4 with test datbase and one user for that DB in vagrant? What is the command/process to do that?
- stephenr 9y agoWhat's your config management tool of choice? I assume they will have recipes/etc for basic tasks like that. Personally I'd just put the call to `apt-get` and then `psql` into a shell script. Either way, set the provisioner. Either do it in vagrant provisioning, or if that takes to long, build a base box with Packer and put the provisioner there. Edit: or for a simpler use, look on Vagrantcloud.com and find a base box that has what you want, and run that.