当前位置:网站首页>当 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
后记
边栏推荐
- C # use Siemens S7 protocol to read and write PLC DB block
- [team learning] [34 issues] scratch (Level 2)
- Advertising attribution: how to measure the value of buying volume?
- [hand torn STL] list
- 抖音或将推出独立种草社区平台:会不会成为第二个小红书
- 计数排序基础思路
- What is Web3
- MySQL forgot how to change the password
- 【數模】Matlab allcycles()函數的源代碼(2021a之前版本沒有)
- This "advanced" technology design 15 years ago makes CPU shine in AI reasoning
猜你喜欢
Chapter 9 Yunji datacanvas company has been ranked top 3 in China's machine learning platform market
Deeply cultivate the developer ecosystem, accelerate the innovation and development of AI industry, and Intel brings many partners together
What if win11 pictures cannot be opened? Repair method of win11 unable to open pictures
Mathematical analysis_ Notes_ Chapter 10: integral with parameters
[team learning] [34 sessions] Alibaba cloud Tianchi online programming training camp
Video fusion cloud platform easycvr video Plaza left column list style optimization
NTU notes 6422quiz review (1-3 sections)
AI 落地新题型 RPA + AI =?
Have you got the same "artifact" of cross architecture development praised by various industry leaders?
What about the collapse of win11 playing pubg? Solution to win11 Jedi survival crash
随机推荐
mpf2_线性规划_CAPM_sharpe_Arbitrage Pricin_Inversion Gauss Jordan_Statsmodel_Pulp_pLU_Cholesky_QR_Jacobi
Fix the problem that the highlight effect of the main menu disappears when the easycvr Video Square is clicked and played
深入解析Kubebuilder
A detailed explanation of head pose estimation [collect good articles]
掌握软件安全测试方法秘笈,安全测试报告信手捏来
Web3 社区中使用的术语
Deeply cultivate the developer ecosystem, accelerate the innovation and development of AI industry, and Intel brings many partners together
Case reward: Intel brings many partners to promote the innovation and development of multi domain AI industry
论文上岸攻略 | 如何快速入门学术论文写作
Terms used in the Web3 community
Code source de la fonction [analogique numérique] MATLAB allcycles () (non disponible avant 2021a)
How to conduct website testing of software testing? Test strategy let's go!
sscanf,sscanf_ S and its related usage "suggested collection"
Lessons and thoughts of the first SQL injection
How to open win11 remote desktop connection? Five methods of win11 Remote Desktop Connection
VM virtual machine operating system not found and NTLDR is missing
Win11 control panel shortcut key win11 multiple methods to open the control panel
MySQL数据库(基础篇)
Tiktok may launch an independent grass planting community platform: will it become the second little red book
DFS和BFS概念及实践+acwing 842 排列数字(dfs) +acwing 844. 走迷宫(bfs)