containerd / containerd/stargz-snapshotter

Optimize Startup Performance for Shared Files Across Images

Open
#2,002 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.6k
Forks
157
Avg merge
8d 8h
Merged PRs (30d)
3

Description

Hi,

I’m trying to further improve container startup performance. Using Stargz Snapshotter with eStargz builds has already provided significant improvements, but I would like to optimize it further, considering that all my images share some common files.

Context:
- Each image represents a different environment, but they all run the exact same HTTP server.
- Before the container starts running, I check that the server is ready by curling it repeatedly until I receive a 200 OK response.

What I’ve Tried:
1. **ctr-remote optimize with cat prefetching**
- I used ctr-remote optimize to cat the HTTP server’s files, but the startup is faster but is still not as fast as expected.
- I assume this is because the files are still being lazily loaded.
2. **Mounting the shared files from a Docker volume**. I tried mounting the HTTP server’s files via a Docker volume to ensure they are readily available. However, it still seems like the files are being lazily loaded.

Question:

How can I further optimize startup performance, considering that all my images have some directories in common that I already know of?
- Is there a way to explicitly specify certain files to be fetched and kept ready on disk before the container starts?
- Would using prefetch directives or other techniques help in ensuring these files are fully loaded before execution?

Any insights or best practices would be greatly appreciated!

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the Stargz Snapshotter prefetch directives and the ctr-remote optimize flow described in the issue. Compare startup measurements while curling for HTTP 200, including shared files mounted from a Docker volume. Done means the relevant shared files are fully available before execution and startup performance improves consistently across the images.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
infrastructure, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.