Hi there
I’ve used a plethora of web servers and proxies/loadbalancers over the years. It all depends on your needs. If you’re a single developer like me, you want the best energy conservation to productivity ratio.
If you have only one site on a VPS then yes, run Phoenix directly!
If you have multiple Phoenix apps and multiple sites then you need something to do load balancing and redirect requests from your 80/443 ports to your apps.
Here i’ve worked with many others and I’d recommend HAproxy, which I’m currently using to handle requests to a variety of apps including Phoenix apps.
Haproxy scales as long as you
- Make sure your VPS/server never writes to SWAP
- Don’t have anyother app which is high CPU intensive on the server where you’ve got haproxy
However, even now as we’re speaking I’m searching a way to use cowboy (or another erlang/elixir land app) for the reverse proxy stuff. I want simplicity and energy/productivity conservation because each app you add-> complexity. I was able to find GitHub - heroku/vegur: Vegur: HTTP Proxy Library. However it hasn’t been updated in some time and I’m not sure it has the latest HTTP/2 support.
I got GitHub - tallarium/reverse_proxy_plug: 🔛 an Elixir reverse proxy Plug with HTTP/2, chunked transfer and path proxying support working perfectly with just ONE LINE of code. However it doesn’t support websockets out of the box.
And this is a bummer.
Scaling will depend on other things aswell, your database will be the hardest hit so you’ll have to decide which databases you’ll want to use and scale that before you’ll have worries about Phoenix.
Good luck