deislabs / wagi

Write HTTP handlers in WebAssembly with a minimal amount of work
Apache License 2.0
889 stars 45 forks source link

Load modules at startup, and clone per request #153

Closed technosophos closed 2 years ago

technosophos commented 2 years ago

This preloads all modules right when Wagi starts up. And then for each request, it clones and executes the module. According to Wasmtime docs, this is a fully supported workflow. I managed to shave off quite a bit more time here than what I got in #151.

Lifting the server siege...
Transactions:                   2433 hits
Availability:                 100.00 %
Elapsed time:                   5.23 secs
Data transferred:              72.78 MB
Response time:                  0.05 secs
Transaction rate:             465.20 trans/sec
Throughput:                    13.92 MB/sec
Concurrency:                   24.86
Successful transactions:        2433
Failed transactions:               0
Longest transaction:            0.13
Shortest transaction:           0.01

Supersedes #151

Signed-off-by: Matt Butcher matt.butcher@fermyon.com