forked from davidmacc/lambda-scaling-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
148 lines (143 loc) · 6.42 KB
/
index.html
File metadata and controls
148 lines (143 loc) · 6.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html lang="en">
<head>
<title>AWS Lambda Scaling Simulator</title>
<meta name="description"
content="Utility to demonstrate AWS Lambda function scaling in burst scenarios. Models cold/warm starts, instance reuse, throttling, concurrency limits, burst concurrency, provisioned concurrency." />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" href="data:,">
<link rel="stylesheet" href="lambdaSim.css">
</head>
<body>
<h1><span style="color: rgb(215, 107, 0)">λ</span> Lambda Scaling Simulator</h1>
<h2>Parameters</h2>
<div class="params">
<div>
<div>
<label for="targetRPS">Invocation Rate</label>
<span id="tooltip-targetRPS" class="info">ⓘ</span>
</div>
<div><input type="number" id="targetRPS" min="1" max="200000" value="150" onchange="runLambdaSim();"> RPS
</div>
</div>
<div>
<div>
<label for="rampupPeriodSec">Ramp-up Period</label>
<span id="tooltip-rampupPeriodSec" class="info">ⓘ</span>
</div>
<div><input type="number" id="rampupPeriodSec" min="1" max="10000" value="10"
onchange="rampUpPeriodUpdated(this); runLambdaSim();"> sec</div>
</div>
<div>
<div>
<label for="coldStartDurationMs">Cold Start Duration</label>
<span id="tooltip-coldStartDurationMs" class="info">ⓘ</span>
</div>
<div><input type="number" id="coldStartDurationMs" min="1" max="600000" value="3000"
onchange="runLambdaSim();"> ms</div>
</div>
<div>
<div>
<label for="warmStartDurationMs">Warm Start Duration</label>
<span id="tooltip-warmStartDurationMs" class="info">ⓘ</span>
</div>
<div><input type="number" id="warmStartDurationMs" min="1" max="600000" value="400"
onchange="runLambdaSim();"> ms</div>
</div>
<div>
<div>
<label for="concurrencyLimit">Concurrency Limit</label>
<span id="tooltip-concurrencyLimit" class="info">ⓘ</span>
</div>
<div><input type="number" id="concurrencyLimit" min="1" max="500000" value="1000"
onchange="runLambdaSim();"></div>
</div>
<div>
<div>
<label for="initialWarmContainers">Initial Warm/Provisioned Capacity</label>
<span id="tooltip-initialWarmContainers" class="info">ⓘ</span>
</div>
<div><input type="number" id="initialWarmContainers" min="0" max="500000" value="0"
onchange="runLambdaSim();"></div>
</div>
<div>
<div>
<label for="simDurationSec">Simulation Period</label>
<span id="tooltip-simDurationSec" class="info">ⓘ</span>
</div>
<div><input type="number" id="simDurationSec" min="1" max="2000" value="20" onchange="runLambdaSim();">
sec</div>
</div>
</div>
<p id="status">...</p>
<h2>Results</h2>
<div class="container">
<canvas id="lambdaChart"></canvas>
</div>
<h2>Summary</h2>
<table class="summary">
<tr>
<td>Simulation Period</td>
<td id="summarySimDuration"></td>
<td></td>
</tr>
<tr>
<td>Invocations Requested</td>
<td id="summaryInvocationsRequested"></td>
<td></td>
</tr>
<tr>
<td> ↳Throttled</td>
<td id="summaryInvocationsThrottled"></td>
<td id="summaryInvocationsThrottledPct"></td>
</tr>
<tr>
<td> ↳Started</td>
<td id="summaryInvocationsStarted"></td>
<td id="summaryInvocationsStartedPct"></td>
</tr>
<tr>
<td> ↳Started (Cold)</td>
<td id="summaryInvocationsStartedCold"></td>
<td id="summaryInvocationsStartedColdPct"></td>
</tr>
<tr>
<td> ↳Started (Warm)</td>
<td id="summaryInvocationsStartedWarm"></td>
<td id="summaryInvocationsStartedWarmPct"></td>
</tr>
<tr>
<td>Peak Concurrency</td>
<td id="summaryConcurrencyMax"></td>
<td></td>
</tr>
<tr>
<td>Average Duration</td>
<td id="summaryAvgDuration"></td>
<td></td>
</tr>
</table>
<p id="notes">
Last updated: 27-NOV-2023 <br/>
GitHub: <a
href="https://github.com/davidmacc/lambda-scaling-simulator">https://github.com/davidmacc/lambda-scaling-simulator</a><br />
Reference docs: <a href="https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html">AWS Lambda
function scaling</a>
</p>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.js"></script>
<script src="lambdaSim.js"></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script>
tippy('#tooltip-targetRPS', { content: 'Number of function invocations to execute [units: requests per second].' });
tippy('#tooltip-rampupPeriodSec', { content: 'Time to ramp-up linearly from 0 RPS to target RPS [units: seconds]' });
tippy('#tooltip-coldStartDurationMs', { content: 'Function duration for a cold-start invocation (new function instance) [units: milliseconds].' });
tippy('#tooltip-warmStartDurationMs', { content: 'Function duration for a warm-start invocation (reused function instance) [units: milliseconds].' });
tippy('#tooltip-concurrencyLimit', { content: 'Maximum concurrency (parallel executions) of the function. Defined using either function-level \'reserved concurrency\' or account-level \'unreserved concurrency\'. Default limit is 1000.' });
tippy('#tooltip-initialWarmContainers', { content: 'Provisioned Concurrency or number of pre-warmed function instances at start of simulation.' });
tippy('#tooltip-simDurationSec', { content: 'Time period to simulate [units: seconds].' });
</script>
</html>