Skip to content

Swap Puma in favour of Falcon as the default web server #951

@ayushn21

Description

@ayushn21

Here's my pitch to swap our default web server. I know we're still only getting v2 out the door, but this is one I'd like to do for v3 ... so a longer term thing.

Why we should

  • Falcon is seriously high performance. Puma is bound by threads, we set a number when we boot Puma up and it's usually in the 10s. Falcon uses fibers .... we don't configure these ... for all practical purposes there isn't an upper limit (technically I believe there is, but we're talking 10s of thousands).
  • Falcon is HTTP/2 native.
  • Falcon is built with streaming in mind. Handling a websocket or SSE connection with Puma is not for the faint hearted. It ties up a thread.... the developer really needs to think about it properly. Action Cable does really funky socket hijacking to take the connection out of Puma. With Falcon, you don't need to worry about that any more ... the way it's built, these things "just work".
  • We can use Falcon for SSL termination ... there's no need to have Caddy/Nginx or something like that in front of it. This will seriously simplify deployments.
  • Falcon is pure Ruby. We should encourage other projects in the Ruby ecosystem, and this is a great chance to have the entire Bridgetown infrastructure run on Ruby without any other pieces like Caddy etc.

Potential pitfalls

  • Falcon is still very new and adoption is limited. But we can and should encourage more widespread use.
  • It's not as battle tested as incumbents so there could be security issues.
  • The community is still fairly small.

Integration issues

I honestly don't think there should be any. The live reload code is the only holdup at the moment and that's easy enough to sort out if we swap to puma. There's a couple of more pieces we need to sort out for Rack compliance, but it's not too relevant I don't think. It should be a straight swap for the most part.

Alongside Falcon, we can also introduce our opinionated deployment tool which I'm currently working on. I've been working with Caddy for SSL termination and a reverse proxy, but bringing all that under the same roof under Falcon would just simplify the setup so much. And it'd all be Ruby!

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions