wmnnd
Phoenix Blog Post: Failing Big with Elixir and LiveView - A Post-Mortem
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused a political party in Germany to cancel their convention.
I wrote this post just a few days after the event took place. As annoying as it was, it was a good teachable moment. And soon I’ll write an update with a tutorial on how to scale to 5,000 concurrent LiveView users on a single VPS ![]()
Most Liked
chrismccord
Very unfortunate title choice for an otherwise interesting post that praises LiveView
chrismccord
Not quite the proper takeaway for all points:
-
Large payloads over PubSub by themselves are just fine. We actually broadcast entire ets tables of presence information when we replicate data for new nodes, so by itself this isn’t a problem
-
This is the key takeaway here. Publishing events at scale must consider downstream subscribers. In this case publishing the entire user list for any individual user change was the mistake, rather than deltas of joins/leaves (or presence)
-
We won’t send anything on the wire if there is an empty diff, so I’d need to know more about this particular case.
crockwave
Fail your way to success
TL;DR for those who haven’t read the well written article yet:
- Avoid large payloads in
Phoenix.PubSubif possible - Throttle PubSub events at the sender level to avoid clogged process inboxes
- Using
assign/3in LiveView always causes an update via Websocket, even if no changes were made
Popular in Blog Posts
Elixir Blog Post: Live video streaming from iOS devices made simple with Elixir & Membrane Framework
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









