A simple http server that runs wasm functions.
-
wasmedge (version v0.11.2)
https://wasmedge.org/docs/embed/c/reference/0.11.x#wasmedge-installation
-
vcpkg
-
g++
-
cmake (version >= 3.19)
-
make
configure
set toolchainFile
to the path of [vcpkg root]/scripts/buildsystems/vcpkg.cmake
in CMakePresets.json
:
{
"version": 3,
"configurePresets": [
{
...
"toolchainFile": "/home/youtirsin/vcpkg/scripts/buildsystems/vcpkg.cmake"
...
}
]
}
and then run:
cmake --preset=default
build
cmake --build build --target wasmkeeper
run
build/wasmkeeper --netns xxx --mod-path ./example/func.wasm
curl -X POST -H "Content-Type: application/json" -d '{"args":["White", "Hank"]}' localhost:10086
# benchmark
ab -n 750 -c 10 -p data.json -T application/json http://localhost:10086/