Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
New Tech
>
Cloud Native
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
49
Star
1.4K
Fork
63
GVP
OpenNJet
/
OpenNJet
Code
Issues
1
Pull Requests
0
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
11
OpenNJet WASM 模块支持
Closed
Leeoo:master
OpenNJet:master
Leeoo
create on 2024-08-29 17:33
Clone/Download
HTTPS
SSH
Copy
Email Patch
Diff file
# 配置示例 ``` server { listen 8080; location / { #开启 wasm 能力 wasm_plugin; # wasm 函数名称 wasm_func_name wasm_hello; # wasm 路径 wasm_plugin_path /root/wasmedgedemo/wasm_hello/target/wasm32-wasi/release/wasm_hello.wasm; } } ``` # wasm 插件程序 编译及使用参考 https://github.com/qianfeiqianlan/rust-wasm-demo # 实现思路 1. 在 njet 启动时创建 wasm 运行时 2. 在 http 请求过来的时候组合相关请求参数 3. 使用组合好的参数调用 wasm 运行时中处理方法 4. 集成了 wasmedge 在 njet lib 中 5. 用户配置时可灵活指定 wasm 文件路径及处理方法名称 # 性能测试 使用 ab 测试在相同机器上 hello world 请求和 njet 原生程序响应速度基本一致,无明显性能损失 ab -n 10000 -c 100 http://localhost:8080/ ``` This is ApacheBench, Version 2.3 <$Revision: 1843412 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requests Server Software: njet/3.0.1 Server Hostname: localhost Server Port: 8080 Document Path: / Document Length: 12 bytes Concurrency Level: 100 Time taken for tests: 0.438 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 1530000 bytes HTML transferred: 120000 bytes Requests per second: 22833.92 [#/sec] (mean) Time per request: 4.379 [ms] (mean) Time per request: 0.044 [ms] (mean, across all concurrent requests) Transfer rate: 3411.71 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 0.3 1 3 Processing: 1 3 0.5 3 36 Waiting: 1 3 0.6 3 34 Total: 3 4 0.4 4 36 Percentage of the requests served within a certain time (ms) 50% 4 66% 4 75% 4 80% 4 90% 4 95% 4 98% 5 99% 5 100% 36 (longest request) ```
This pull request needs to pass some approval items
Type
Assign personnel
Status
Reviewer
zhaoygf
In progress
(0/1 )
Tester
zhaoygf
In progress
(0/1 )
How to merge Pull Request
git checkout master
git pull https://gitee.com/qianeiqianlan/njet.git master
git push origin master
Comments
5
Commits
16
Files
32
Checks
Code problems
0
Bulk operation
Expand
Collapse
Reviewer
Code Owner
Reviewer
Admin
sinogrid_0
liuqi
liuqi-sun
shanlei
stdanley
liismn
liismn
洪昕
hongxintml
lmins017
lmins017
zhaoygf
zhaoygf
chenluboTM
chenluboTM
No Setting
Min number
1
Tester
Admin
sinogrid_0
liuqi
liuqi-sun
shanlei
stdanley
liismn
liismn
洪昕
hongxintml
lmins017
lmins017
zhaoygf
zhaoygf
chenluboTM
chenluboTM
No Setting
Min number
1
Priority
Not specified
Serious
Main
Secondary
Unimportant
Label
No Setting
Link Issue
No link issue
Successfully merged pull requests will close issues
Milestone
No related milestones
Q3 milestone
OpenNJet 功能规划以及亮点总结
NJet支持sts模块
NJet的lua模块支持pcre2
Participators
(2)
C
1
https://gitee.com/njet-rd/njet.git
git@gitee.com:njet-rd/njet.git
njet-rd
njet
OpenNJet
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register