SlimFaas.png

SlimFaas: The Slimmest, Simplest & Autoscaling-First Function-as-a-Service

Continuous Integration Quality Gate Reliability Security Code Coverage Docker SlimFaas Docker Image Size Docker Image Version FOSSA Status FOSSA Status

SlimFaas is a lightweight, plug-and-play Function-as-a-Service (FaaS) platform for Kubernetes (and Docker-Compose / Podman-Compose). It’s designed to be fast, simple, and extremely slim — with a very opinionated, autoscaling-first design:

  • 0 → N wake-up from HTTP history & schedules,
  • 0 → N wake-up from Kafka lag via the companion SlimFaas Kafka service,
  • N → M scaling powered by PromQL,
  • internal metrics store, debug endpoints, and scale-to-zero out of the box.

Looking for MCP integration? Check out SlimFaas MCP — the companion runtime that converts any OpenAPI definition into MCP-ready tools on the fly.


Why Use SlimFaas?

🚀 Autoscaling that actually understands your traffic

SlimFaas puts autoscaling at the center of the design:

  • Scale-to-zero & cold-start control

    • Scale down to 0 after inactivity with configurable timeouts.
    • Wake up from 0 → N based on real HTTP history and/or time-based schedules.
    • Wake up from 0 → N based on Kafka topic activity: SlimFaas Kafka watches consumer group lag and calls the wake-up API whenever there are pending messages or recent consumption.
    • Control initial capacity via ReplicasAtStart to avoid thundering herds.
  • Two-phase scaling model

    • 0 → N: driven by HTTP history, schedules, dependencies and Kafka lag (via SlimFaas Kafka) to bring functions online only when needed.
    • N → M: driven by Prometheus metrics and a built-in PromQL mini-evaluator.
    • The metrics-based autoscaler only runs once at least one pod exists — no “metrics from the void”.
  • PromQL-driven autoscaler (no external HPA required)

    • Write PromQL-style triggers like:
      • sum(rate(http_server_requests_seconds_count{...}[1m]))
      • max_over_time(slimfaas_function_queue_ready_items{function="my-func"}[30s])
      • histogram_quantile(0.95, sum by (le) (rate(http_server_requests_seconds_bucket{...}[1m])))
    • Targets can be interpreted as “per pod” (AverageValue) or global (Value).
    • Scale-up/scale-down policies and stabilization windows inspired by HPA/KEDA.
  • Integrated metrics scraper (no Prometheus mandatory in the hot path)

    • SlimFaas scrapes only the HTTP metrics endpoints of pods with Prometheus annotations.
    • It stores only the metrics you actually request in your triggers or debug queries.
    • A single SlimFaas node is responsible for scraping and writing to the shared store; all nodes read from it.
  • Debug-friendly autoscaling

    • POST /debug/promql/eval – evaluate any PromQL expression against the internal store.
    • GET /debug/store – see what metrics SlimFaas is scraping and how much data it keeps.
    • Designed so you can reason about “what SlimFaas sees” when it makes scaling decisions.
  • FinOps-friendly by design

    • 30-minute metrics retention window for predictable memory usage.
    • Native scale-to-zero + schedules to keep non-critical workloads cold outside of business hours.
    • Super slim runtime so your control plane does not become the new bottleneck.

🧵 Synchronous and Asynchronous Functions

  • Simple HTTP endpoints for both sync and async calls.
  • Async mode:
    • Limit parallelism per function.
    • Configure retries and backoff strategies.
    • Drive scaling decisions based on queue metrics.

⏱ Jobs

  • Run one-off, batch, and scheduled (cron) jobs via HTTP.
  • Control:
    • concurrency,
    • visibility (public/private),
    • and lifecycles.

🔐 Private/Public Functions and Jobs

  • Expose only what you need:
    • Internal functions stay private and are accessible only from within the cluster or trusted pods.
    • Public functions can be routed via Ingress / API Gateways.

📣 Publish/Subscribe Internal Events

  • Synchronously broadcast events to every replica of selected functions.
  • No external event bus required — perfect for simple fan-out, cache invalidation, or configuration refresh scenarios.

🧠 “Mind Changer” (Status & Wake-up API)

  • A built-in REST API to:
    • inspect the current state of your functions,
    • wake them up on demand,
    • integrate health/usage information into your own dashboards.

🔌 Plug and Play

  • Deploy SlimFaas as a standard pod/StatefulSet with minimal configuration.
  • Onboard existing workloads by adding annotations to your Deployments:
    • let SlimFaas manage their replicas and autoscaling,
    • keep your existing containers and tooling.

⚡ Slim & Fast

  • Written in .NET with a focus on:
    • low CPU and memory footprint,
    • AOT-friendly code paths,
    • minimal dependencies.

slim-faas-ram-cpu.png


Ready to Get Started?

Dive into the documentation:

  • Get Started – Learn how to deploy SlimFaas on Kubernetes or Docker Compose.
  • Autoscaling – Deep-dive into 0 → N / N → M autoscaling, PromQL triggers, metrics scraping, and debug endpoints. (See the documentation/autoscaling guide in this repo.)
  • Kafka Connector – Use Kafka topic lag to wake functions from 0 → N and keep workers alive while messages are still flowing.
  • Functions – See how to call functions synchronously or asynchronously.
  • Events – Explore how to use internal synchronous publish/subscribe events.
  • Jobs – Learn how to define and run one-off jobs.
  • How It Works – Dive into SlimFaas’s architecture and design.
  • Planet Saver – See how to start and monitor replicas from a JavaScript frontend.
  • MCP – Discover how to convert any OpenAPI definition into MCP-ready tools on the fly.

We hope SlimFaas helps you cut costs, simplify autoscaling, and keep your serverless workloads slim.


Community & Governance

Enjoy SlimFaas!


Adopters

List of organizations using this project in production or at stages of testing.

AXA.png


Add your logo via a pull request:

  • Logo must be in PNG format, 100 px width, and 100 px height.
  • Add your logo to the documentation/adopters folder.