edgelab

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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

View Source
const (
	// AccountLimit is the most instances running at once across functions.
	AccountLimit = 200
)

Variables

This section is empty.

Functions

func New

func New(cfg labkit.Config) http.Handler

New returns EdgeLab's handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL