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

[merge] feat(wasmtime) new 'cache_config' directive for compilation cache #540

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

thibaultcha
Copy link
Member

@thibaultcha thibaultcha commented Apr 24, 2024

No description provided.

This adds support for `wasmtime { cache_config <config.toml>; }`, which
enables disk caching of ahead-of-time compilation of `.wasm` files.

This should alleviate noticeable CPU spikes when starting up workers using
Wasmtime and Wasm modules larger than a few megabytes.

Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
@thibaultcha thibaultcha changed the title feat(wasmtime) new 'cache_config' directive for compilation cache [merge] feat(wasmtime) new 'cache_config' directive for compilation cache Apr 24, 2024
Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Merging #540 (308766c) into main (bb139e1) will decrease coverage by 0.00623%.
Report is 2 commits behind head on main.
The diff coverage is 89.47368%.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##                main        #540         +/-   ##
===================================================
- Coverage   90.06471%   90.05848%   -0.00624%     
===================================================
  Files             47          47                 
  Lines          10045       10089         +44     
===================================================
+ Hits            9047        9086         +39     
- Misses           998        1003          +5     
Files Coverage Δ
src/wasm/ngx_wasm_core_module.c 92.64706% <ø> (ø)
src/wasm/wrt/ngx_wrt_wasmtime.c 82.56881% <89.47368%> (+0.36816%) ⬆️

... and 2 files with indirect coverage changes

Flag Coverage Δ
unit 90.15117% <86.66667%> (+0.01973%) ⬆️
valgrind 78.01542% <26.31579%> (-0.14838%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@thibaultcha thibaultcha merged commit 91d447f into main Apr 24, 2024
35 checks passed
@thibaultcha thibaultcha deleted the feat/wasmtime-config-cache-merge branch April 24, 2024 23:04
flrgh added a commit to Kong/kong that referenced this pull request Jun 5, 2024
* feat(wasm): add support for wasmtime cache

This adds support for Wasmtime's module caching.
See also:

* Kong/ngx_wasm_module#540
* https://github.com/Kong/ngx_wasm_module/blob/b19d405403ca6765c548e571010aea3af1accaea/docs/DIRECTIVES.md?plain=1#L136-L149
* https://docs.wasmtime.dev/cli-cache.html

* tests(wasm): add start/restart test for wasmtime cache
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

Successfully merging this pull request may close these issues.

2 participants