Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]:How do I obtain and limit the resources used by WASM? #1533

Closed
springrain opened this issue Jun 21, 2023 · 3 comments
Closed

[question]:How do I obtain and limit the resources used by WASM? #1533

springrain opened this issue Jun 21, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@springrain
Copy link

How do I obtain and limit the resources used by WASM?
Mainly CPU, memory, disk IO, execution time,. like blockchain contract gas

@springrain springrain added the enhancement New feature or request label Jun 21, 2023
@ncruces
Copy link
Collaborator

ncruces commented Jun 21, 2023

You create your runtime with wazero.NewRuntimeWithConfig, and use the following to limit:

Those are the available ones.

@springrain
Copy link
Author

springrain commented Jun 22, 2023

Does Wazero have any plans to enhance resource-related features?
wasmer and WasmEdge set a gas value for each instruction, and the host function can set the gas value itself to calculate the total gas used to execute wasm. Wazero doesn't know if there's a plan?
Getting and limit gas is important for cloud functions and faas.

@codefromthecrypt
Copy link
Contributor

@springrain this is a duplicate of #422. There are notes throughout that issue and also some technical notes in #1108 as to why we closed it.

You can subscribe to #422 in case something changes which allows us to re-visit the topic with new information besides demand. For now, what @ncruces mentioned is the current workaround and agree it is not the same as emulating a fuel concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants