Skip to content
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

Optimize Startup Performance for Shared Files Across Images #2002

Open
sevetseh28 opened this issue Mar 5, 2025 · 0 comments
Open

Optimize Startup Performance for Shared Files Across Images #2002

sevetseh28 opened this issue Mar 5, 2025 · 0 comments

Comments

@sevetseh28
Copy link

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.
  1. 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!

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

No branches or pull requests

1 participant