当前位置:网站首页>当 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
后记
边栏推荐
- 一图看懂!为什么学校教了你Coding但还是不会的原因...
- Canteen user dish relationship system (C language course design)
- The easycvr platform is connected to the RTMP protocol, and the interface call prompts how to solve the error of obtaining video recording?
- Win11远程桌面连接怎么打开?Win11远程桌面连接的五种方法
- 计数排序基础思路
- JetBrain Pycharm的一系列快捷键
- 未婚夫捐5亿美元给女PI,让她不用申请项目,招150位科学家,安心做科研!
- Wechat can play the trumpet. Pinduoduo was found guilty of infringement. The shipment of byte VR equipment ranks second in the world. Today, more big news is here
- A picture to understand! Why did the school teach you coding but still not
- AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
猜你喜欢

Deeply cultivate the developer ecosystem, accelerate the innovation and development of AI industry, and Intel brings many partners together
![[practice leads to truth] is the introduction of import and require really the same as what is said on the Internet](/img/58/4337f0972f7171a5c21e640f03e0b7.png)
[practice leads to truth] is the introduction of import and require really the same as what is said on the Internet

This "advanced" technology design 15 years ago makes CPU shine in AI reasoning

How to solve the problem of adding RTSP device to easycvr cluster version and prompting server ID error?

Win11 control panel shortcut key win11 multiple methods to open the control panel

Oracle - views and sequences

Intel David tuhy: the reason for the success of Intel aoten Technology

System framework of PureMVC

【实践出真理】import和require的引入方式真的和网上说的一样吗

视频融合云平台EasyCVR视频广场左侧栏列表样式优化
随机推荐
Terms used in the Web3 community
mpf2_ Linear programming_ CAPM_ sharpe_ Arbitrage Pricin_ Inversion Gauss Jordan_ Statsmodel_ Pulp_ pLU_ Cholesky_ QR_ Jacobi
On the 110th anniversary of Turing's birth, has the prediction of intelligent machine come true?
Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million
过气光刻机也不能卖给中国!美国无理施压荷兰ASML,国产芯片再遭打压
leetcode 53. Maximum Subarray 最大子数组和(中等)
关于01背包个人的一些理解
VM virtual machine operating system not found and NTLDR is missing
Analyse approfondie de kubebuilder
Code source de la fonction [analogique numérique] MATLAB allcycles () (non disponible avant 2021a)
掌握软件安全测试方法秘笈,安全测试报告信手捏来
Field data acquisition and edge calculation scheme of CNC machine tools
Data security -- 12 -- Analysis of privacy protection
图灵诞辰110周年,智能机器预言成真了吗?
[digital analog] source code of MATLAB allcycles() function (not available before 2021a)
Introduction to the PureMVC series
Poor math students who once dropped out of school won the fields award this year
Vscode automatically adds a semicolon and jumps to the next line
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
食堂用户菜品关系系统(C语言课设)