spinframework / spinframework/spin
Different execution times for python spin app on local machine and Fermyon Cloud
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
Hello,
I am testing a Python-based spin serverless app for execution performance (https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_float/run_benchmark.py). (Edited the source code to fit the spin application format). I cannot seem to understand why is there more than a 2x difference in execution time when I time the application locally, time curl http://127.0.0.1:3000/float gives around 0.84 sec compared 0.41 sec when deployed on Fermyon Cloud (including the network latency). Moreover, if I execute the http trigger using a python program to simulate a poisson workload (on avg 2req/sec ), then for many requests I get execution times of even 1.5s. I do not think that there should be a 2x execution time difference even for a local setup (64GB RAM 8cores VM) compared to the cloud platform.
The spin.toml file is the following:
`spin_manifest_version = 2
[application]
authors = ["Abdul Monum abdulmonum@gmail.com"]
description = "float serverless function adapted from pyperformance"
name = "float"
version = "0.1.0"
[[trigger.http]]
route = "/float"
component = "float"
[component.float]
source = "app.wasm"
[component.float.build]
command = "componentize-py -w spin-http componentize app -o app.wasm"
watch = ["*.py", "requirements.txt"]`
- Spin version (
spin --version)
spin 2.4.2 (340378e 2024-04-03) - Wasmtime version
wasmtime-cli 20.0.0 (9e1084ffa 2024-04-22) - Installed plugin versions (
cloud 0.8.0 [installed] js2wasm 0.6.1 [installed] py2wasm 0.3.2 [installed])
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the adapted pyperformance benchmark in run_benchmark.py and the spin.toml manifest, then reproduce the /float timings using the stated Spin and Wasmtime versions. Compare local and Fermyon Cloud behavior under the described workload; done means the execution-time discrepancy is explained with actionable guidance or a confirmed fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, wasm
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100