Production-Grade Container Scheduling and Management
Go to file
Kubernetes Submit Queue 6dfe5c49f6 Merge pull request #38865 from vwfs/ext4_no_lazy_init
Automatic merge from submit-queue

Enable lazy initialization of ext3/ext4 filesystems

**What this PR does / why we need it**: It enables lazy inode table and journal initialization in ext3 and ext4.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #30752, fixes #30240

**Release note**:
```release-note
Enable lazy inode table and journal initialization for ext3 and ext4
```

**Special notes for your reviewer**:
This PR removes the extended options to mkfs.ext3/mkfs.ext4, so that the defaults (enabled) for lazy initialization are used.

These extended options come from a script that was historically located at */usr/share/google/safe_format_and_mount* and later ported to GO so this dependency to the script could be removed. After some search, I found the original script here: https://github.com/GoogleCloudPlatform/compute-image-packages/blob/legacy/google-startup-scripts/usr/share/google/safe_format_and_mount

Checking the history of this script, I found the commit [Disable lazy init of inode table and journal.](4d7346f7f5). This one introduces the extended flags with this description:
```
Now that discard with guaranteed zeroing is supported by PD,
initializing them is really fast and prevents perf from being affected
when the filesystem is first mounted.
```

The problem is, that this is not true for all cloud providers and all disk types, e.g. Azure and AWS. I only tested with magnetic disks on Azure and AWS, so maybe it's different for SSDs on these cloud providers. The result is that this performance optimization dramatically increases the time needed to format a disk in such cases.

When mkfs.ext4 is told to not lazily initialize the inode tables and the check for guaranteed zeroing on discard fails, it falls back to a very naive implementation that simply loops and writes zeroed buffers to the disk. Performance on this highly depends on free memory and also uses up all this free memory for write caching, reducing performance of everything else in the system. 

As of https://github.com/kubernetes/kubernetes/issues/30752, there is also something inside kubelet that somehow degrades performance of all this. It's however not exactly known what it is but I'd assume it has something to do with cgroups throttling IO or memory. 

I checked the kernel code for lazy inode table initialization. The nice thing is, that the kernel also does the guaranteed zeroing on discard check. If it is guaranteed, the kernel uses discard for the lazy initialization, which should finish in a just few seconds. If it is not guaranteed, it falls back to using *bio*s, which does not require the use of the write cache. The result is, that free memory is not required and not touched, thus performance is maxed and the system does not suffer.

As the original reason for disabling lazy init was a performance optimization and the kernel already does this optimization by default (and in a much better way), I'd suggest to completely remove these flags and rely on the kernel to do it in the best way.
2017-01-18 09:09:52 -08:00
.github
api generated: swagger 2017-01-16 16:13:30 -05:00
build Wait until kubernetes-src.tar.gz is build before building node/server. 2017-01-11 15:55:44 -08:00
cluster Merge pull request #38865 from vwfs/ext4_no_lazy_init 2017-01-18 09:09:52 -08:00
cmd Merge pull request #40041 from deads2k/generic-25-undo-admission 2017-01-18 08:37:53 -08:00
docs Fix broken link to logging documentation 2017-01-15 00:14:12 -08:00
examples Merge pull request #39709 from smarterclayton/object_meta 2017-01-17 15:32:33 -08:00
federation move admission to genericapiserver 2017-01-18 08:15:19 -05:00
Godeps bump(k8s.io/gengo):3c6a809462caf39389d70d9ea787ed24c5acffed 2017-01-16 16:13:31 -05:00
hack move pkg/client/transport to client-go 2017-01-18 07:56:01 -05:00
hooks Fix spelling in package naming linter error message 2016-12-20 15:48:14 -05:00
logo
pkg Merge pull request #38865 from vwfs/ext4_no_lazy_init 2017-01-18 09:09:52 -08:00
plugin move admission to genericapiserver 2017-01-18 08:15:19 -05:00
staging Merge pull request #40041 from deads2k/generic-25-undo-admission 2017-01-18 08:37:53 -08:00
test Merge pull request #38865 from vwfs/ext4_no_lazy_init 2017-01-18 09:09:52 -08:00
third_party start the apimachinery repo 2017-01-11 09:09:48 -05:00
translations Add initial translation support. 2016-12-23 20:45:52 -08:00
vendor Merge pull request #40041 from deads2k/generic-25-undo-admission 2017-01-18 08:37:53 -08:00
.gazelcfg.json Generate a dummy BUILD file in _output/local/go to keep Bazel out of trouble 2017-01-05 22:05:17 -08:00
.generated_docs add create rolebinding 2016-12-21 09:03:27 -05:00
.generated_files
.gitattributes
.gitignore
BUILD.bazel Add a rule to create kubernetes-src.tar.gz 2017-01-05 14:14:13 -08:00
CHANGELOG.md Update CHANGELOG.md for v1.5.2. 2017-01-11 23:06:30 -08:00
code-of-conduct.md
CONTRIBUTING.md
labels.yaml
LICENSE
Makefile make help should be bazel aware 2017-01-06 14:56:01 -08:00
Makefile.generated_files Remove a from each codegen path 2016-12-30 18:44:32 -08:00
OWNERS
OWNERS_ALIASES OWNERS: Create sig-node alias 2017-01-17 16:25:40 -08:00
README.md
Vagrantfile
WORKSPACE build test binary with bazel 2017-01-09 14:39:15 -08:00

Kubernetes

Submit Queue Widget GoDoc Widget Coverage Status Widget

Introduction

Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications. Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF)

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.


Are you ...

Code of Conduct

The Kubernetes community abides by the CNCF code of conduct. Here is an excerpt:

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

Community

Do you want to help "shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented? ". If you are a company, you should consider joining the CNCF. For details about who's involved in CNCF and how Kubernetes plays a role, read the announcement. For general information about our community see the website community page.

Join us on social media (Twitter, Google+) and read our blog

Ask questions and help answer them on Slack or Stack Overflow

Attend our key events (kubecon, cloudnativecon, weekly community meeting)

Join a Special Interest Group (SIG)

Contribute

If you're interested in being a contributor and want to get involved in developing Kubernetes, get started with this reading:

You will then most certainly gain a lot from joining a SIG, attending the regular hangouts as well as the community meeting.

If you have an idea for a new feature, see the Kubernetes Features repository for a list of features that are coming in new releases as well as details on how to propose one.

Building Kubernetes for the impatient

If you want to build Kubernetes right away there are two options:

$ go get -d k8s.io/kubernetes
$ cd $GOPATH/src/k8s.io/kubernetes
$ make
$ git clone https://github.com/kubernetes/kubernetes
$ cd kubernetes
$ make quick-release

If you are less impatient, head over to the developer's documentation.

Support

While there are many different channels that you can use to get hold of us (Slack, Stack Overflow, Issues, Forums/Mailing lists), you can help make sure that we are efficient in getting you the help that you need.

If you need support, start with the troubleshooting guide and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another. We don't bite!

Analytics