当前位置:网站首页>当 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
后记
边栏推荐
- 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
- Break the memory wall with CPU scheme? Learn from PayPal to expand the capacity of aoteng, and the volume of missed fraud transactions can be reduced to 1/30
- leetcode 53. Maximum Subarray 最大子数组和(中等)
- 视频融合云平台EasyCVR视频广场左侧栏列表样式优化
- leetcode 53. Maximum Subarray 最大子数组和(中等)
- Organize five stages of actual attack and defense drill
- ESG Global Leaders Summit | Intel Wang Rui: coping with global climate challenges with the power of science and technology
- Chapter 9 Yunji datacanvas company has been ranked top 3 in China's machine learning platform market
- 《原动力 x 云原生正发声 降本增效大讲堂》第三讲——Kubernetes 集群利用率提升实践
- Up to 5million per person per year! Choose people instead of projects, focus on basic scientific research, and scientists dominate the "new cornerstone" funded by Tencent to start the application
猜你喜欢
Introduction to namespace Basics
程序员上班摸鱼,这么玩才高端!
深耕开发者生态,加速AI产业创新发展 英特尔携众多合作伙伴共聚
This "advanced" technology design 15 years ago makes CPU shine in AI reasoning
案例大赏:英特尔携众多合作伙伴推动多领域AI产业创新发展
Camera calibration (I): robot hand eye calibration
EasyCVR集群重启导致其他服务器设备通道状态离线情况的优化
[hand torn STL] list
Optimization of channel status offline of other server devices caused by easycvr cluster restart
The request request is encapsulated in uni app, which is easy to understand
随机推荐
赠票速抢|行业大咖纵论软件的质量与效能 QECon大会来啦
jvm是什么?jvm调优有哪些目的?
R语言主成分pca、因子分析、聚类对地区经济研究分析重庆市经济指标
Advertising attribution: how to measure the value of buying volume?
广告归因:买量如何做价值衡量?
mpf2_ Linear programming_ CAPM_ sharpe_ Arbitrage Pricin_ Inversion Gauss Jordan_ Statsmodel_ Pulp_ pLU_ Cholesky_ QR_ Jacobi
《原动力 x 云原生正发声 降本增效大讲堂》第三讲——Kubernetes 集群利用率提升实践
Zhou Yajin, a top safety scholar of Zhejiang University, is a curiosity driven activist
Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice
软件测试之网站测试如何进行?测试小攻略走起!
MySQL forgot how to change the password
What if win11 pictures cannot be opened? Repair method of win11 unable to open pictures
Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!
MySQL split method usage
R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators
Fix the problem that the highlight effect of the main menu disappears when the easycvr Video Square is clicked and played
Complimentary tickets quick grab | industry bigwigs talk about the quality and efficiency of software qecon conference is coming
Win11玩绝地求生(PUBG)崩溃怎么办?Win11玩绝地求生崩溃解决方法
Network Security Learning - Information Collection
[practice leads to truth] is the introduction of import and require really the same as what is said on the Internet