News for hackers. Stuff that matters.
Re:Making EC2 boot time 8x faster by develatio on Thursday May 23, 2024 @11:32AM (#40455968)
Maybe AWS should actually take a look into this. I know comparing AWS to other (smaller) cloud providers is not totally fair given the size of AWS, but for example creating / booting an instance in Hetzner takes a few seconds.
Re:Making EC2 boot time 8x faster by everfrustrated on Thursday May 23, 2024 @12:23PM (#40456657)
Hetzner does not offer a network block storage comparable to EBS that can be used as a root (bootable) file system. AWS local-attached ephemeral disk are also immediately available but cannot be seeded with data (same as Hetzner they are wiped clean ahead of boot).
Re:Making EC2 boot time 8x faster by andersa on Thursday May 23, 2024 @12:33PM (#40456780)
This is an advantage. EBS is terrible! Literally orders of magnitude slower than modern SSDs.
Re:Making EC2 boot time 8x faster by stingraycharles on Thursday May 23, 2024 @01:29PM (#40457499)
Depends on your definition of slow. Throughput-wise, I think it’s fairly decent — we typically set up 4 EBS volumes in raid0 and get 4GB/sec for a really decent price.
Re:Making EC2 boot time 8x faster by Nextgrid on Thursday May 23, 2024 @02:16PM (#40457993)
Sequential throughput can be fine. Random access is always going to be orders of magnitude slower than a direct-attach disk.

Remember why we switched from spinning hard drives to SSDs? Well EBS is like going back to a spinning drive.

Re:Making EC2 boot time 8x faster by Aeolun on Thursday May 23, 2024 @09:30PM (#40461967)
I think AWS is aware of this. Which is why they have instances with attached SSD’s
Re:Making EC2 boot time 8x faster by Nextgrid on Friday May 24, 2024 @03:17PM (#40469572)
However, you can't boot off them, and they don't build anything to facilitate their usage as a boot drive, even though it's perfect for use-cases like these where the machine is ephemeral and its local drive doesn't actually matter.

They should have a feature where you can provide it an S3 URL or EBS snapshot when launching an instance, and the control plane would write it to the local ephemeral direct-attach volume on launch.

Currently if you wanted to do that you'd have to roll your own with a minimal EBS as your root volume containing iPXE or some other minimal OS that is capable of formatting the direct-attach NVME and populating it before passing control to it (via kexec/etc?).

But I guess since EBS incurs additional cost, there's no incentive for them to make it easier to move away. I bet that in aggregate they're making quite good money off mostly unnecessary EBS volumes that don't actually contain any useful data.

Re:Making EC2 boot time 8x faster by flybarrel on Friday May 24, 2024 @09:22AM (#40466009)
Depends on what volume types you are using. For random access - with io2 you can get 256K IOPS per volume, and if you do RAID0, on the largest instance you can get 400K IOPS. Directly-attached vs over-the-network storage can be fairly different, but going back to a spinning drive is not a fair statement.
Re:Making EC2 boot time 8x faster by Nextgrid on Friday May 24, 2024 @03:14PM (#40469548)
You are talking about concurrent IOPS which is fair enough, you can indeed scale that. But every individual one of those IOPS would still have far higher latency than direct-attach storage.

This is a problem when IO operations have to be sequential and can't be parallelized such as when they depend on each other (database has to first read the index to know where the actual data is, then do another IO to actually read said data).

Having lots of IOPS could allow you to make multiple of these queries in parallel (assuming locking/etc doesn't get in the way), but it still means every individual query would be slower than on direct-attach storage.

Re:Making EC2 boot time 8x faster by tekla on Thursday May 23, 2024 @12:41PM (#40456879)
EBS is great for workloads that dont require SSDs, which most don't.

If it does, you can do provisioned which will get you alot more or go NVME.

Re:Making EC2 boot time 8x faster by Nextgrid on Thursday May 23, 2024 @02:17PM (#40458010)
Even provisioned won't get you the access times of a direct-attached SSD. Speed of light and all that - EBS is using the network under the hood, it's not a direct connection to the host.
Re:Making EC2 boot time 8x faster by tekla on Thursday May 23, 2024 @02:31PM (#40458151)
Yes I know, and? Thats why I mentioned NVME
Re:Making EC2 boot time 8x faster by tekla on Thursday May 23, 2024 @12:05PM (#40456459)
They have and I know this because I've hammered them on this because we demand thousands of instances to autoscale very aggressively in 1-3 minutes. Very few people give a shit about initialization times. They care more about instance ready times which is constrained by the OS that is running.
Re:Making EC2 boot time 8x faster by matt-p on Thursday May 23, 2024 @11:41AM (#40456108)
What's size got to do with boot time? Serious question.
Re:Making EC2 boot time 8x faster by RationPhantoms on Thursday May 23, 2024 @11:45AM (#40456166)
More employed eyes on an issue or ability to compensate the best-in-class engineers to take a look.
Re:Making EC2 boot time 8x faster by matt-p on Thursday May 23, 2024 @07:47PM (#40461274)
Exactly, so a large provider should theoretically have faster boot times if anything, no? More chance of having a customer who cares deeply, more wasted CPU cycles (and therefore incentive to optimise) as it's multiplied by 10 million rather than 10 thousand instance starts. More likely to have larger quantities of engineers available, more monitoring/data/telematics.
Re:Making EC2 boot time 8x faster by develatio on Thursday May 23, 2024 @12:03PM (#40456419)
By "the size" I meant to say "the size of the infrastructure", meaning that AWS has to manage orders of magnitude more instances than Hetzner. This might as well contribute to "things" being slower.
Re:Making EC2 boot time 8x faster by londons_explore on Thursday May 23, 2024 @12:21PM (#40456631)
Arguably it can also make things faster. A small provider might need to migrate other instances around to make space for your new instance, whereas a big provider almost certainly can satisfy your request from existing free capacity, and it should therefore be a matter of milliseconds to identify the physical machine your new VM will run on.
Re:Making EC2 boot time 8x faster by matt-p on Thursday May 23, 2024 @07:52PM (#40461310)
I understand that, apologies for not making that clear.

I guess I'm just struggling to see how having more VMs means it takes longer to provision one? A database query to find the space and get an allocation should be milliseconds in either case.

Re:Making EC2 boot time 8x faster by playingalong on Thursday May 23, 2024 @12:08PM (#40456492)
Likely they mean that following Conway's law in AWS there are more abstraction layers involved.
Re:Making EC2 boot time 8x faster by matt-p on Thursday May 23, 2024 @07:55PM (#40461333)
Most likely true, but things are going deeply wrong if fresh Debian VM boot times are a function of the organisational structure of your hosting provider.
Re:Making EC2 boot time 8x faster by CaptainOfCoit on Thursday May 23, 2024 @11:52AM (#40456268)
Smaller companies are faster and more nimble than larger corporations.
Re:Making EC2 boot time 8x faster by matt-p on Thursday May 23, 2024 @07:50PM (#40461295)
Yes, but why specifically does that mean boot times of a VM are faster? One has to be 'nimble' to improve that?
Re:Making EC2 boot time 8x faster by ldoughty on Friday May 24, 2024 @06:57AM (#40464861)
The article mentions hydration (a process to reduce the penalty of first access of a data block). This is done by essentially reading the entire EBS volume with the tool like fio or dd. The time it takes to complete this process is relative to the amount of dirty blocks. Therefore, it will take twice as long to hydrate 20 GB of data compared to 10 GB.
Re:Making EC2 boot time 8x faster by torginus on Thursday May 23, 2024 @01:25PM (#40457438)
It also takes a few seconds on AWS. The guy is comparing setting up a whole new machine from an image, with network and all, to turning on a stopped EC2 instance.

The latter takes a few seconds, the former is presumably longer. This is the great relevation of this blog post.

Re:Making EC2 boot time 8x faster by dylan604 on Thursday May 23, 2024 @02:01PM (#40457833)
wait, restarting a stopped machine is faster than launching an AMI from scracth is a great revelation?

That's like saying waking your MacbookPro is faster than booting from powered off state. Of course it is, and that's precisely why the option exists.

Re:Making EC2 boot time 8x faster by jpambrun on Thursday May 23, 2024 @03:51PM (#40459121)
I think this is unexpected. I expected that once created, my boot volume would have the same performance on the first boot than on the second. It's really not obvious that the volume is really empty and lazily loaded from S3. The proposed work around is also a bit silly: read all blocks one by one even tho maybe 1% of the block have something in them on a new VM. This is actually a revelation.
Re:Making EC2 boot time 8x faster by mdeeks on Thursday May 23, 2024 @03:31PM (#40458905)
If you aren't familiar with how EBS works and how volumes are warmed, then yes, this is an interesting blog post. Not everyone is an expert. They become experts by reading things like this and learning.

If you didn't know about this EBS behavior it would be logical to assume that booting from scratch is roughly equivalent to starting/stopping/starting again.

Re:Making EC2 boot time 8x faster by pluies on Friday May 24, 2024 @06:43AM (#40464797)
It's definitely news to me!

Intuitively, I would have expected AWS to send back the EBS volume backing a powered-off machine into the Whatever Long-Term Storage Is Behind EBS, and therefore start-up time to be ~identical to a fresh start as the steps would be the same: retrieve data from long-term storage into a readable EBS volume, start VM etc.

It's very interesting that it is not the case, and that keeping the EBS volume around after a first boot makes a second boot so much faster.

Re:Making EC2 boot time 8x faster by dylan604 on Friday May 24, 2024 @09:37AM (#40466141)
If that were the case, then there would be absolutely no benefit from having a stop vs terminate. Unless you've written data to the EBS volume, but in these cases where the boot time is critical most of them are some sort of read-only volume anyways. The fact that an EC2 can be stopped or terminated should immediately suggest speed might be a difference in reaching the running state. In the EBS docs, it clearly states that if you keep an EBS volume around either attached to a stopped EC2 or detached and left in your pool of volumes, you will be charged for that volume.
Re:Making EC2 boot time 8x faster by attentive on Thursday May 23, 2024 @03:48PM (#40459092)
It depends on instance type and OS and can be real short on ec2.
Re:Making EC2 boot time 8x faster by flaminHotSpeedo on Friday May 24, 2024 @03:15AM (#40463717)
At least if you're using the Ec2 optimized amis, Ec2 instances frequently boot fast enough that they'll be executing your username initialization before you get the run instances response.

Though there's a long tail, so sometimes there can be a gap on the order of a couple second between the sync response and when the bootloader transfers over to the kernel.