๐Ÿš€ Software ยท LARZ-201 · Session 8 of 8

Scaling & Performance

One server takes you surprisingly far. When you outgrow it, Larz scales the boring, reliable way - more workers, caching, and moving the slow work off the request.

⏱ 10 min read📅 Updated 2026-07-25📊 Code examples throughout

Most apps never need exotic scaling - a single well-configured box handles real traffic. But when you do grow, Larz scales predictably: it's a standard WSGI app, so you add workers and machines behind a load balancer, cache the hot paths, and push slow work into background jobs.

Scale out with workers

# more gunicorn workers = more concurrency (Larz is sync/WSGI)
gunicorn -w 8 -c deploy/gunicorn.conf.py app:app
# then run several machines behind a load balancer; keep sessions stateless

Cache the hot paths, defer the slow ones

@app.cache(ttl=60)                  # serve read-heavy routes from cache
@app.get('/leaderboard')
def board(req): ...

@app.job                            # move slow work off the request thread
def render_report(uid): heavy(uid)

Takeaways

  • One server goes far - measure before you scale, and scale the boring way.
  • Larz is WSGI: add workers and machines behind a load balancer; keep state in the DB, not memory.
  • Cache read-heavy routes and defer slow work to background jobs.

More in this course

Course home → · Browse all courses →