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

Redundant file copies for every pod start #40

Open
radu-matei opened this issue Mar 13, 2024 · 3 comments
Open

Redundant file copies for every pod start #40

radu-matei opened this issue Mar 13, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@radu-matei
Copy link
Member

The startup time for a Spin application distributed as an OCI artifact is affected by several copies of the Wasm components and static assets on disk.

Since this time is spent on every pod start, my assumption is that it affects performance, in particular for applications with a higher number of components and assets.

I'd like to see if we can improve this, potentially by implementing a Spin application loader that directly uses the runwasi list of WasmLayers and skips all the copies.

@radu-matei radu-matei added the help wanted Extra attention is needed label Mar 13, 2024
@jsturtevant
Copy link
Contributor

Another idea along these lines that I had would be to implement an In-memory cache provider that would skip the write to disk as well.

@rajatjindal
Copy link
Contributor

Hi @jsturtevant, just trying to understand your suggestion here. are you saying to have these static assets loaded in memory and serve from there?

@jsturtevant
Copy link
Contributor

Yes, they are already in memory via the WasmLayers struct. There is a concept of a Cache in Spin which currently reads from a specific folder, which is why we write the files to disk. I thought we might be able to create a new implementation of the cache that reads from the pre-loaded memory instead of writing to disk then reading it again. This would speed things up a bit by avoiding the IO but may not be ideal in all cases when the there are lots of files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants