Documentation
¶
Overview ¶
Package edgelab is EdgeLab, a small serverless app on a simulated function platform: a link shortener whose routes are functions (create a link, redirect, stats, a link-preview image) running on instances that start cold, stay warm while used, are reclaimed when idle, and are limited in number per function. It is the reference app for the serverless pack.
Each response says whether it started cold (X-Cold-Start), which instance served it, and how long init and execution took (Server-Timing). Over a function's concurrency limit the answer is 429 with Retry-After, as function platforms throttle.
Planted bottlenecks (see README.md), each switched off by a fix flag:
- init: a cold start loads the whole bundle, 400 modules, before the first request (800ms) (fix "init" loads 40 up front and the rest when first needed: 80ms).
- prewarm: no instances are kept ready, so every burst of traffic pays cold starts (fix "prewarm" keeps five provisioned instances of each function warm).
- pool: every invocation opens its own database connection (20ms) and closes it (fix "pool" opens one per instance at init and reuses it).
Index ¶
Constants ¶
const (
// AccountLimit is the most instances running at once across functions.
AccountLimit = 200
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.