Giter Site home page Giter Site logo

hyperwasm's Introduction

多线程版

multi_thread

hyper-sched

仅在Ubuntu 22.04环境下运行,需要root权限

cargo build --release --package hyper-scheduler --example server 
sudo ./target/release/examples/server

curl -F "fib.wasm=@/home/zhanghao/dev/hyper-scheduler/examples/fib.wasm" http://127.0.0.1:3001/register

curl -F "fib.wasm=@/tmp/122.96.144.180:30080/hywasm/fib46.wasm/latest/module.wasm" http://127.0.0.1:3001/register

/call
curl -H "Content-Type: application/json" -d '{"wasm_name":"fib.wasm","task_unique_name":"fibabc","export_func":"fib_r","param_type":"i32","params":["30"],"results_length":"1","expected_execution_time":"5","expected_deadline":"35"}' -X POST http://127.0.0.1:3001/call

curl -H "Content-Type: application/json" -d '{"wasm_name":"detect.wasm","task_unique_name":"detectabc","export_func":"detect","param_type":"void","params":[],"results_length":"1","expected_execution_time":"215","expected_deadline":"300"}' -X POST http://127.0.0.1:3001/call

/test
curl -H "Content-Type: application/json" -d '{"wasm_name":"fib.wasm","export_func":"fib","param_type":"i32","params":["32"],"results_length":"1","expected_deadline":"30"}' -X POST http://127.0.0.1:3001/test

  1. 在设置任务的预期执行时间前先测试该任务在本机环境下的执行时长

  2. 建议绑定CPU运行: 修改内核启动参数

         sudo vim /etc/default/grub
    

    隔离CPU0和CPU1

         GRUB_CMDLINE_LINUX="isolcpus=0,1"
    

    更新

         sudo update-grub
    

    重启后生效

  3. 需要开启cgroupV2 要授权其他控制器,如 cpu cpuset 和 io ,执行以下命令:

     sudo mkdir -p /etc/systemd/system/[email protected]
     cat <<EOF | sudo tee /etc/systemd/system/[email protected]/delegate.conf
     [Service]
     Delegate=cpu cpuset io memory pids
     EOF

     sudo systemctl daemon-reload

Inspiration

stuck: Multi-threading task facility building on cooperative stackful coroutine.

hyperwasm's People

Contributors

zhhcs avatar

Stargazers

jiangtao zheng avatar kingshuo xu avatar  avatar  avatar  avatar  avatar 5TUZKI avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.