Processes & scaling

Web and workers
scaled separately

List web, worker and release commands in a Procfile. Each runs in its own containers, and only web gets traffic.

Procfile

Detected

    On every deploy

      How it works

      From Procfile to replicas

      No Procfile? Your image’s own command runs as web.

      01

      Add a Procfile

      List web, worker and, if you need one, a release command.

      web: npm start
      worker: node worker.js

      02

      Deploy

      Each process type starts with one container. Only web gets traffic.

      git push slasha main

      03

      Scale up

      Add web replicas for traffic or workers for a long queue.

      slasha scale web=3 worker=2

      Scaling

      Scale web and workers separately

      A long job queue doesn’t mean extra web servers. Change counts from the Scaling tab or the CLI.

      • Several at once: web=3 worker=2
      • Minimum of one per process type
      • Later deploys keep the same count
      slasha scale
      storefront · Scaling
      webServes HTTP traffic
      workerBackground jobs
      $

      Routing

      Only web gets traffic from the internet

      Caddy spreads requests across your web containers. Workers sit on the app’s private network with its databases, out of reach from outside.

      • Traffic shared across web replicas
      • Workers reach databases but aren’t public
      • A failed release command stops the deploy
      Processes & scaling

      storefront.ship.acme.dev

      ↓ Caddy · HTTPS

      web × 3gets traffic
      worker × 2private
      dbprivate

      storefront private network

      One container per replica

      Each replica has its own name in the logs

      Each replica is its own container that restarts if it crashes. If web.2 misbehaves, you can see it and filter to it.

      • Log prefixes like web.0 and worker.1
      • Filter with slasha logs -p worker
      Logs & metrics
      ~/storefront

      $ slasha scale web=3 worker=2

      Scaled web to 3.

      Scaled worker to 2.

      $ slasha logs -f

      [web.0] GET /products 200 · 24ms

      [web.2] GET /checkout 200 · 37ms

      [worker.1] send-receipt #8812 done

      [web.1] POST /cart 201 · 41ms

      [worker.0] sync-inventory #8813 done

      More servers

      Add more servers when you need them

      Add servers as nodes and choose where each app runs. Give a busy API its own server, or move an app to a bigger one.

      • Pick a node when you create an app
      • Moving an app copies its volumes
      • One dashboard and CLI for all of them
      Servers & nodes

      local

      • storefront
      • docs
      • admin

      eu-worker-1

      • api
      • image-worker

      Limits

      What Slasha doesn’t do (yet)

      Good to know before you plan around it.

      No autoscaling

      Counts only change when you change them. Metrics and alerts tell you when.

      No CPU or memory limits

      Processes on a server share its CPU and memory.

      One node per app

      All of an app’s processes run on one server. Spread load across apps.

      More details

      Procfile

      web, worker and release. Each line is one command.

      No Procfile needed

      Without one, the image’s own command runs as web.

      Release phase

      Migrations run once before new processes start.

      Scaling tab

      Increase, decrease and apply from the dashboard.

      One command

      slasha scale web=3 worker=2 from any machine.

      Zero-downtime deploys

      Each web replica passes a health check before traffic moves.

      Shared /data

      Every process gets the app’s managed volume at /data.

      PORT injected

      Slasha sets PORT: your own value, your EXPOSE port or 8080.

      Questions about processes & scaling

      Have another question? Ask on GitHub.

      Does Slasha autoscale?
      No. You choose how many web and worker processes run, and Slasha keeps that many running. Scale up before a launch and back down after, from the dashboard or with slasha scale.
      Can I set CPU or memory limits per process?
      Not today. Slasha doesn’t set CPU or memory limits on app containers, so processes share the server’s resources. Watch usage in metrics, and add an alert if you want to know when it gets high.
      What about process types other than web, worker and release?
      Slasha ignores them. If you need something on a schedule, such as a clock process, use a cron job instead. It runs your app’s image on a schedule.
      Can I scale a process to zero?
      No, the minimum is one. You can’t scale release at all, because it runs once per deploy.
      Can one app’s processes run on several servers?
      No. An app runs on one node, and all of its processes run there. You can add more servers as nodes and put different apps on different servers, or move an app to a bigger one.
      Does scaling need a redeploy?
      No. Scaling changes the running deployment. New containers start from the same image, and extra ones are stopped. Later deploys use the same count.

      Other features

      All features

      Run and scale your app’s processes

      Free and open source. Your first app can be live in ten minutes.

      $curl -fsSL https://slasha.com/setup.sh | bash