Skip to content

Running Your App

This section covers how to run your Application Kit-based services.

Granian is the recommended server for Application Kit applications. It provides:

  • HTTP/2 cleartext (h2c) - Required for internal service communication
  • High performance - ~50k req/s, ~15MB memory per worker
  • Unified server - Supports both ASGI (FastAPI) and WSGI (Django)

Quick Start

# Development
granian --interface asgi --reload myapp.main:app

# Production with HTTP/2
granian --interface asgi --workers 4 --http 2 myapp.main:app
# Development
granian --interface wsgi --reload myapp.wsgi:application

# Production with HTTP/2
granian --interface wsgi --workers 4 --http 2 myapp.wsgi:application

Why h2c?

Internal services communicate behind a load balancer that terminates TLS. HTTP/2 cleartext (h2c) provides:

  • Multiplexing - Multiple requests over a single connection
  • Header compression - Reduced overhead for repeated headers
  • Stream prioritization - Better resource utilization
# Test h2c with curl
curl --http2-prior-knowledge http://localhost:8000/

Guides