Comments (12)
@alexeyPetrushin Itβs on our roadmap to provide metering of memory/cpu instructions and preemption based on those values and possibly timeouts.
from wasmer.
Thanks for asking!
By design, webassembly is sandboxed by default. Aside from that, any sandboxing is really on the interface that's imported into your webassembly modules.
Our current emscripten implementation is not sandboxed whatsoever, but a strict security model is on our roadmap for future wasm abi implementations.
from wasmer.
It is possible to limit the memory size, yes. But it's not possible to limit the CPU frequency. I think it falls to the OS to slow down the Wasmer runtime process. I don't know yet how to do that though.
from wasmer.
Thank you! Is it possible to limit the execution time (roughly, with precision like +-100milliseconds for example)?
As for the memory limit - can you please point me to docs or info how to specify it?
from wasmer.
- Instead of limiting execution time, wasmer can limit the number of instructions executed: metering.rs.
- 2Γ2GB is probably simply the limit addressable in 32 bit wasm? A lower limit can be set through tunables.
from wasmer.
Sounds good. Since your home page shows starting a web server, I presumed that meant you had built in certain capabilities already. So I figured it was worth asking. Glad to hear it's in the plans. Maybe this or else more precise issues are worth keeping open until you have plans implemented and/or documented.
from wasmer.
By design, webassembly is sandboxed by default
Is it possible to set CPU cycle limit and Memory limit?
from wasmer.
It is possible to limit the memory size, yes.
How would you do that? I don't see and interface for that in wasmer_runtime::Module::instantiate.
In my tests, some Wasm was able to allocate 2x2 GB before hitting some kind of default limit.
from wasmer.
I'm looking into adding an execution timeout middleware, what do you think the best way to go about it would be? My current plan would be to just implicitly depend on a wasi clock_time_get
import and compare that value with some preset one, but are there any other ways to monitor time in wasm/wasmer without depending on imports?
from wasmer.
As for the memory limit - can you please point me to docs or info how to specify it?
from wasmer.
@coolreader18 I think it's a good idea to start with something simple, even based on the host clock. I'll let you open an issue or a PR to track your progression and the discussion :-).
from wasmer.
Quick clarification: Wasmer VM is fully sandboxed by default. Wasmer is also fully sandboxed when used with WASI
from wasmer.
Related Issues (20)
- How to Add custom function along with wasi HOT 3
- Does wasmer guaranties execution of instruction in atomic way in case of trap? HOT 1
- Replace BinaryPackage::uses with PackageId
- Fix wasmer_api::query::fetch_webc_package
- `backend_api`: fix fetch_webc_package HOT 1
- Improve deploy flow by automatically authing the user if in interactive mode
- Remove webc v1 support
- webc v3: Use the webc-volume timestamps in the webc virtual-fs filesystem implementation
- wasmer app create: Fails with custom path
- wasmer app create: --no-wait is not respected HOT 1
- wasmer run python/python -- --version should be instant
- Fix timestamps in Pirita and Wasmer
- We should not compute the hash of wasm modules inside of WebC
- Add Integration tests for all parts of the wasmer deploy + publish flow
- Improve codebase - deploy flow (unnamed packages)
- Fix ``wasmer publish`` not bumping versions for named packages
- Prompt user login for anonymous user when using `wasmer deploy`, `wasmer publish`
- new `wasmer publish` flow
- Add support for tagging a package release with a named package version
- Add support for pushing package releases and tagging them HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmer.