-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Kaniko Performance Testing. #1305
Comments
Hi @tejal29, we were investigating the performance image for the https://github.com/redhat-developer/build project. The improvements are great. I also investigated the exact changes that were done. Introducing a file system snapshotting mode that works without looking at the file content is foreseeable a great improvement. The fact that the algorithm seems to be proven due to previous usages in other projects gives us confidence. The So, my current assessment for https://github.com/redhat-developer/build is to only use the new snapshot mode. The performance improvements also look good. Is there an outlook when this becomes officially supported as part of a Kaniko release? |
Hi @tejal29. I noticed the v0.24.0 release. Thank you for doing that. What about my concerns about the |
@SaschaSchwarze0, Thanks for all your questions.
The way we detect file deletions with We build a dictionary of files in previous layer and current FS. Detect deletions by traversing both the dictionaries. Re:
I think you maybe right. I haven't had time to investigate further. It was an experiment which i put out there. This might now work for most of the cases like you mentioned. |
Thank you @tejal29 for your answer:
Okay, in my interpretation this is then still some kind of a snapshot of the filesystem, but creating a dictionary of existing files obviously is faster than building any hash for each file even if the file content is ignored. So, we continue with |
yes! |
As another data point, for a build based on a Jupyter image: 20 to 55 minutes before (on a self-hosted GitLab CI runner), 2 minutes after. Definitely a massive improvement. |
I managed to resolve the problem in my GitLab CI configuration by incorporating the enhancement introduced in this GitHub issue: #1680. All you have to do is utilize version 1.8.0 or any older version and specify the |
|
Hello Kaniko Users,
A lot of kaniko users have mentioned, snapshotting has been a bottleneck especially for
npm
,yarn
andapt
projects which end up downloading a number of dependencies.see issues #1282, #972
We have a new Kaniko Images with a bunch of improvements described below.
Over the last month, we did a bunch of improvements like
go.Walk
With the changes above, for 700K files, we saw an improvement of ~23%
The Total Build time reduced from 30 minutes to 22 minutes for below
Dockerfile
which created a N number of files inRun
Note: This does not mimic real world
npm
, orapt
scenarios since the files created as random text files in one directory.In order, to further decrease the snapshotting time, we added 2 new features:
In this snapshot strategy, to detect file changes, unlike the Full Snapshot Modethe contents of the file are not hashed. Only the following Attributes of the files are hashed.
See (https://apenwarr.ca/log/20181113) to understand "mtime" could result in snapshot errors.
Using
redo
snapshotter, reduced the build time from 30 mins to 12 mins about 56% improvement.The time spent in computing hash for all the files in FS, reduced from 15 mins to mere 18 seconds.
Note: These are small text files and in
full
snapshot mode the time to hash a file depends on the file size.You can use the new
redo
snapshotter with the following command line argument--snapshotMode=redo
.Run
command which does not rely on snapshotting at all.In this approach, in order to compute which files were changed, by creating a marker file before executing the
Run
command.Then we walk the entire filesystem which takes about 1 to 3 seconds for 700Kfiles, to find all files whose
ModTime
is greater than the marker file.With this new run command implementation, the total build time is reduced for 29 mins to 7 mins with a huge improvement of 75%
To use the new
Run
command implementation, use--use-new-run=true
flag.I am looking forward for all kaniko users to try these new flags and let us know if they help make your builds faster
The text was updated successfully, but these errors were encountered: