-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ami,gce]: reduce snapshot size to minimum allowed #491
Conversation
861e66e
to
a8b5b64
Compare
fixed typos in commit message :-) |
This change might cause disk-space issues due to grow-log-files etc. on the OS level, |
Running https://jenkins.scylladb.com/job/scylla-master/job/releng-testing/job/longevity/job/longevity-100gb-4h-test/32/console, the log shows that the instance is with 30Gb root disk
So i assume it's good, will wait for @fruch to review as well to make sure |
what about the swap ? isn't that create on build time ? or it's not anymore ? |
Also, I think SCT would be o.k. with that, but places like cloudformation and such, might have usability issue and should extend to pick bigger root disks. |
@@ -4,40 +4,6 @@ | |||
"name": "aws", | |||
"type": "amazon-ebs", | |||
"access_key": "{{user `access_key`}}", | |||
"ami_block_device_mappings": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how this is related to the snapshot size ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not been used. so I removed it. I can update the commit message or split it to different commit
Also what about GCP/AZure ? there we have smaller disks ? |
Swap creation including the calculation is been handled in https://github.com/scylladb/scylla-machine-image/blob/next/packer/scylla_install_image |
No, they still using 30Gb. I will adjust it in a follow up patch |
Not sure if anyone is using the cloudformation, and even if someone is using it, shouldn't it be for POC or testing/evaluating Scylla? |
a8b5b64
to
fda06bc
Compare
@fruch Added another commit with the clenaup |
Only GCE has this configuration, trying to do it in the PR to see if it's working |
1b435e1
to
249d66e
Compare
@fruch Added also GCE with minimal disk size (10Gb) - verified with https://jenkins.scylladb.com/job/scylla-master/job/releng-testing/job/gce-image/95/ and also with https://jenkins.scylladb.com/job/scylla-master/job/releng-testing/job/longevity/job/longevity-10gb-3h-gce-test/22/ |
that was the reason for enlarging the root disk in the fist place, so we can create the swap upfront. |
Why we incleased rootfs size from 10GB to 30GB was because there was not enough disk space for the swapfile (c22807f). (Recommended swap size for Scylla is either total_mem/3 or 16GB - lower of the two, so 10GB of rootfs is almost always not enough) I think we probably should move swapfile to /var/lib/scylla (data volume) instead of rootfs, then we will have enough space without enlarge rootfs . |
We can have the AMI set to 10GB and in the documentation or anywhere it's used (terraform?) we ask to set with bigger disk. |
This reverts commit 069318b. Related with scylladb#491, we need to reduce snapshot size of the rootfs, we should not pre-allocate swapfile while building image.
This reverts commit 069318b. Related with scylladb#491, we need to reduce snapshot size of the rootfs, we should not pre-allocate swapfile while building image.
This reverts commit 069318b. Related with scylladb#491, we need to reduce snapshot size of the rootfs, we should not pre-allocate swapfile while building image.
This reverts commit 069318b. Related with scylladb#491, we need to reduce snapshot size of the rootfs, we should not pre-allocate swapfile while building image.
249d66e
to
3b506d9
Compare
Verified https://jenkins.scylladb.com/job/scylla-master/job/releng-testing/job/next-machine-image/257/ (including rebased) |
@roydahan When someone wants to set an instance based on our images, we must set the size of the root disk anyway. So I don't think we should have any impact on that. @tzach Any reason not to reduce the size to the minimum? |
@benipeled @Annamikhlin Please review |
Nothing changed since my last review - #491 (comment) - if it's verified by SCT and the swap change handled, go ahead |
I tried to look in our documentation and I couldn't find anyware in AMI launch for scylladb, explaination on how much to configure for root FS (swap but also logs and other things). |
I am not sure we have such we do have https://opensource.docs.scylladb.com/stable/kb/set-up-swap.html . so i am not sure why not set it during scylla_image_setup. it shouldn't take long |
Not that I'm aware of. Primarily, we need to run all standard tests with this image. |
It won't matter because the tests are configuring it with the required root FS size that will have enough space for swap. TBH, I think it's a change that confuse users and may break some users automations. |
Every AMI we create today holds a 30Gb EBS snapshot, if we take into account the fact that we copy those images to other regions and have multiple images (dev, debug, releases) it is adding up to our cost. This commit reduces the size of the snapshot to 8Gb (it's the minimum value allowed for a snapshot) In addition, it's reducing also the time for the build process from 30 minutes to ~12 minutes (which is also good) Refs: scylladb/scylla-pkg#3712
3b506d9
to
cbf8845
Compare
@roydahan Does it make sense to do this automatically for all users? I'm not comfortable updating production image settings without testing! |
the only why you might force people to set bigger root disks, if the image root disk is bigger you can automate in any other way, if you are giving them ami-id. now it's 30Gb, and no on can create something smaller it's a UX question, cause now if user were counting someone on their process on the default size to o.k. for them and with the swap size that comes default, all other users that specific the sizes of root-disks regardless, won't notice it. (they already use >=30Gb now)
It would be test once it hit master, but with tools that all specify the root disk size with >=30Gb |
TBH I think this change doesn't worth the pain and bad UX for fresh install. |
It is thousands of dollars on EBS costs, btw. |
It's thousands of dollars if you don't delete the snapshots, but AFAIU we do now, and won't save more than 180 days. I think it's worth the user experience of launching our AMI with the defaults value and scylla fails to setup since there is not enough disk space to configure swap. We're spending much much more money on instances that people don't terminate and live for months... |
Just 1 AMI per day would be great - but it's per region, no?
We can work on improving the user experience too.
We'll get there too. The fact we have instances running >1 week that are not production ones - should be one of our next item. |
Actually, we are creating many more AMI's , during December we created 173 AMI's in Some of them for debug and some are official releases/master
|
Reducing the AMI size saves only 500$ in a course of 6 months, calculating 2 AMIs for master and 2 AMIs for enterprise. There are other places where we can save for snapshots, taking them in this task: https://github.com/scylladb/scylla-pkg/issues/3712 |
Every AMI we create today holds a 30Gb EBS snapshot, if we take into account the fact that we copy those images to other regions and have multiple images (dev, debug, releases) it is adding up to our cost.
This commit reduces the size of the snapshot to 8Gb (it's the minimum value allowed for a snapshot)
In addition, it's reducing also the time for the build process from 30 minutes to ~12 minutes (which is also good)
Refs: https://github.com/scylladb/scylla-pkg/issues/3712