Skip to content

Added guidelines for scaling firecracker VMs count #396

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

Merged
merged 1 commit into from
Mar 2, 2020

Conversation

ustiugov
Copy link
Contributor

I have put together a set of guidelines to configure the host OS to scale the number of microVMs past one thousand (tested with 1500 microVMs on a host with 256GB memory). Feedback is welcome.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@IRCody IRCody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Can you Add the "Signed-off-by" to your commit also?

@ustiugov
Copy link
Contributor Author

@IRCody Thank you for the corrections, please check.

docs/scaling.md Outdated
Comment on lines 16 to 27
sudo sh -c "echo \"* soft nofile 1000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"* hard nofile 1000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"root soft nofile 1000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"root hard nofile 1000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"* soft nproc 4000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"* hard nproc 4000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"root soft nproc 4000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"root hard nproc 4000000\" >> /etc/security/limits.conf"
sudo sh -c "echo \"* soft stack 65536\" >> /etc/security/limits.conf"
sudo sh -c "echo \"* hard stack 65536\" >> /etc/security/limits.conf"
sudo sh -c "echo \"root soft stack 65536\" >> /etc/security/limits.conf"
sudo sh -c "echo \"root hard stack 65536\" >> /etc/security/limits.conf"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this section, it would make sense to show that as a file, rather then the sequence of echo commands like https://github.com/firecracker-microvm/firecracker-containerd/blob/master/docs/getting-started.md#configure-firecracker-containerd-binary.

Regarding the configuration itself, I have a few questions.

  • Do we need to have root and * separately? Doesn't * cover root?
  • Assuming that Firecracker is running as a separate Linux user, not root, can we specifically target the user instead of essentially removing the limits for all of them?

Copy link
Contributor Author

@ustiugov ustiugov Feb 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kzys Thank you for the feedback, I have applied it.

  • root and the rest of the users are managed separately in Ubuntu, please see here for details.
  • The orchestrator (like the one in examples/taskworkflow.go) runs with sudo (at least, in the quickstart/getting-started example commands) and it creates a lot of threads and processes. As a result, it can hit one of the system limits as well as VMs themselves.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I didn't know that * doesn't include root.

I can understand why we need more nofile and nproc, but not so sure about stack. Does something consume more stack by having more VMs?

@ustiugov ustiugov force-pushed the scaling_readme branch 2 times, most recently from fbb1252 to 635b243 Compare February 25, 2020 12:15
@IRCody
Copy link
Contributor

IRCody commented Feb 25, 2020

Thanks for the update @ustiugov. The CI is failing on checking DCO/subject length. I think if you amend your commit and add a line between your commit subject and the Signed-off-by line it will pass.

Copy link
Contributor

@kzys kzys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@kzys kzys merged commit f7734c5 into firecracker-microvm:master Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants