Senior Track Roadmap

Kamal proxy: Thruster

This course covers Thruster, the Go binary that wraps Puma inside the application container. It starts with the cost of serving static files from Puma's limited request slots, then reads the Gemfile and Dockerfile lines that make up the whole integration. Lessons explain how X-Sendfile hands file transfers from Rails to the proxy, why digest-named assets make a one-year cache safe, and how compression is decided by content type. The course also covers what Thruster leaves to kamal-proxy and Rails, and how to measure whether it helps.

What you'll learn

  • ✓Why static files and slow clients tie up Puma's request slots
  • ✓How the Dockerfile CMD wraps Puma with Thruster and keeps the entrypoint check working
  • ✓How X-Sendfile lets Rails authorize a file and hand the transfer to the proxy
  • ✓Why digest-named assets make a one-year cache safe, and how compression is decided
  • ✓How assume_ssl and force_ssl avoid a redirect loop between kamal-proxy and Thruster
  • ✓How to measure Ruby threads spent on requests that need no Ruby
Free preview · Lesson 1 3 min read

The job Puma should not do

Puma is a Ruby web server, and it's very good at running Ruby. Something else usually sits in front of it because serving a static file isn't running Ruby, and doing it in a Ruby thread is expensive in a specific way.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...