当前位置:网站首页>当 Knative 遇见 WebAssembly
当 Knative 遇见 WebAssembly
2022-07-06 22:15:00 【InfoQ】
从 WASM、WASI 到 WAGI


WAGI 应用冷启动分析与优化
$ ab -k -n 10000 -c 100 http://127.0.0.1:3000/
...
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
Document Path: /
Document Length: 12 bytes
Concurrency Level: 100
Time taken for tests: 7.632 seconds
Complete requests: 10000
Failed requests: 0
Keep-Alive requests: 10000
Total transferred: 1510000 bytes
HTML transferred: 120000 bytes
Requests per second: 1310.31 [#/sec] (mean)
Time per request: 76.318 [ms] (mean)
Time per request: 0.763 [ms] (mean, across all concurrent requests)
Transfer rate: 193.22 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.6 0 9
Processing: 8 76 29.6 74 214
Waiting: 1 76 29.6 74 214
Total: 8 76 29.5 74 214
Percentage of the requests served within a certain time (ms)
50% 74
66% 88
75% 95
80% 100
90% 115
95% 125
98% 139
99% 150
100% 214 (longest request)

$ ab -k -n 10000 -c 100 http://127.0.0.1:3000/
...
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
Document Path: /
Document Length: 12 bytes
Concurrency Level: 100
Time taken for tests: 1.328 seconds
Complete requests: 10000
Failed requests: 0
Keep-Alive requests: 10000
Total transferred: 1510000 bytes
HTML transferred: 120000 bytes
Requests per second: 7532.13 [#/sec] (mean)
Time per request: 13.276 [ms] (mean)
Time per request: 0.133 [ms] (mean, across all concurrent requests)
Transfer rate: 1110.70 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.6 0 9
Processing: 1 13 5.7 13 37
Waiting: 1 13 5.7 13 37
Total: 1 13 5.6 13 37
Percentage of the requests served within a certain time (ms)
50% 13
66% 15
75% 17
80% 18
90% 21
95% 23
98% 25
99% 27
100% 37 (longest request)

利用 Knative 运行 WAGI 应用
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: autoscale-wagi
namespace: default
spec:
template:
metadata:
annotations:
# Knative concurrency-based autoscaling (default).
autoscaling.knative.dev/class: kpa.autoscaling.knative.dev
autoscaling.knative.dev/metric: concurrency
# Target 10 requests in-flight per pod.
autoscaling.knative.dev/target: "10"
# Disable scale to zero with a min scale of 1.
autoscaling.knative.dev/min-scale: "1"
# Limit scaling to 100 pods.
autoscaling.knative.dev/max-scale: "10"
spec:
containers:
- image: registry.cn-hangzhou.aliyuncs.com/denverdino/knative-wagi:0.8.1-with-cache
- 容器镜像 knative-wagi 包含了 WAGI 网关和一些示例的 WASI 应用,更多细节可以参考项目[7]。
- autoscale-wagi 服务可以根据请求数进行弹性伸缩
$ kubectl apply -f knative_test.yaml
$ kubectl get ksvc autoscale-wagi
NAME URL LATESTCREATED LATESTREADY READY REASON
autoscale-wagi http://autoscale-wagi.default.127.0.0.1.sslip.io autoscale-wagi-00002 autoscale-wagi-00002 True
$ curl http://autoscale-wagi.default.127.0.0.1.sslip.io
Oh hi world
$ curl http://autoscale-wagi.default.127.0.0.1.sslip.io/hello
hello world
后记
边栏推荐
- Read of shell internal value command
- Programmers go to work fishing, so play high-end!
- 这项15年前的「超前」技术设计,让CPU在AI推理中大放光彩
- EasyCVR视频广场点击播放时,主菜单高亮效果消失问题的修复
- Win11远程桌面连接怎么打开?Win11远程桌面连接的五种方法
- The request request is encapsulated in uni app, which is easy to understand
- Intel and Xinbu technology jointly build a machine vision development kit to jointly promote the transformation of industrial intelligence
- Data security -- 12 -- Analysis of privacy protection
- B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
- Digital chemical plants realize the coexistence of advantages of high quality, low cost and fast efficiency
猜你喜欢
![A detailed explanation of head pose estimation [collect good articles]](/img/22/7ae0b12c3d945b449bcc8bb4a8961b.jpg)
A detailed explanation of head pose estimation [collect good articles]

EasyCVR集群重启导致其他服务器设备通道状态离线情况的优化

MySQL数据库(基础篇)

R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators

【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ
![Local tool [Navicat] connects to remote [MySQL] operation](/img/e8/a7533bac4a70ab5aa3fe15f9b0fcb0.jpg)
Local tool [Navicat] connects to remote [MySQL] operation

Oracle - views and sequences

In depth analysis of kubebuilder

How does vscade use the built-in browser?

英特尔与信步科技共同打造机器视觉开发套件,协力推动工业智能化转型
随机推荐
A series of shortcut keys for jetbrain pychar
What about the collapse of win11 playing pubg? Solution to win11 Jedi survival crash
leetcode 53. Maximum Subarray 最大子数组和(中等)
Some understandings about 01 backpacker
Easycvr cannot be played using webrtc. How to solve it?
Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!
MySQL forgot how to change the password
You can't sell the used lithography machine to China! The United States unreasonably pressured the Dutch ASML, and domestic chips were suppressed again
The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
未婚夫捐5亿美元给女PI,让她不用申请项目,招150位科学家,安心做科研!
Code source de la fonction [analogique numérique] MATLAB allcycles () (non disponible avant 2021a)
Nanopineo use development process record
Gpt-3 is a peer review online when it has been submitted for its own research
NTU notes 6422quiz review (1-3 sections)
程序员上班摸鱼,这么玩才高端!
Common methods of list and map
视频融合云平台EasyCVR视频广场左侧栏列表样式优化
【数模】Matlab allcycles()函数的源代码(2021a之前版本没有)
Oracle - views and sequences
MySQL split method usage