Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Failed to load Wasm module in Istio #8

Closed
MengjiaLiang opened this issue Mar 21, 2023 · 2 comments
Closed

Failed to load Wasm module in Istio #8

MengjiaLiang opened this issue Mar 21, 2023 · 2 comments

Comments

@MengjiaLiang
Copy link

HI @anuraaga, thank you for releasing such a great GC strategy in proxy-wasm!

I am having trouble with the default GC in TinyGo(v0.27.0) as well.
When I try to compile my wasm plugin use nottinygc and follow the instructions in the readme, the compilation works. But when I deploy it into a k8s cluster with Istio(v1.14 and v1.16), the envoy shows the error when loading the wasm module.

Here is the error message inside envoy proxy.

Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.sched_yield

Do you have any insights for such an issue? Appreciate your help!

@anuraaga
Copy link
Contributor

anuraaga commented Mar 22, 2023

Hi @MengjiaLiang - thanks for the question. This is a known issue with Envoy which I have just added docs for, I think that should fix it for you

https://github.com/wasilibs/nottinygc#using-with-envoy

For context, it is the same approach we use here

https://github.com/corazawaf/coraza-proxy-wasm/blob/main/init_tinygo.go#L14

@MengjiaLiang
Copy link
Author

Thank you Anuraag for the quick response!
This works great now!

From my load testing result, the memory usage of Istio(that uses the default GC) increases linearly along with the traffic volume.
After replacing the gc and malloc with nottinygc, I didn't see too much CPU increment, but the memory usage will be stable at some level no matter how much the traffic volume is. This is brilliant!

Appreciate your help again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants