SE-Radio Episode 349: Gary Rennie on Phoenix

Topics covered
Popular Clips
Episode Highlights
Benchmarking
shares his experience with benchmarking Phoenix's real-time capabilities, using a chat application as a test case. Initially, the results were modest, achieving around 30,000 concurrent connections. However, after some optimizations, including a small code deletion, the performance improved to 50,000 connections 1. Rennie highlights the importance of using tools like Erlang's observer to identify bottlenecks, such as a growing message queue in a timer process 2.
We realized that cowboy, the web server we're using, does it anyway. So we actually just deleted the entire pinging code and still had the same functionality.
---
By addressing these bottlenecks, they managed to support up to 450,000 concurrent users on a single machine, although still not at WhatsApp's scale 2.
Data Optimization
Optimizing data types within Phoenix is crucial for performance. explains how choosing the right data structures, such as using ETS instead of a local hash dict, can significantly enhance efficiency 3. He emphasizes the importance of understanding data types upfront to avoid bottlenecks, as seen when switching from a bag to a duplicate bag in ETS, which improved user handling rates 4.
The thing we were getting bottlenecked on was ETS checking for duplicates as it was inserting new sessions.
---
These optimizations allowed Phoenix to handle up to 2 million connections, although the test was artificial and not reflective of typical use cases 4.
Related Episodes


Episode 394: Chris McCord on Phoenix LiveView
Answers 383 questions

SE-Radio Episode 295: Michael Feathers on Legacy Code
Answers 383 questions
SE-Radio-Episode-249:-Vaughn-Vernon-on-Reactive-Programming-with-the-Actor-Model
Answers 383 questions

SE Radio 594: Sean Moriarity on Deep Learning with Elixir and Axon
Answers 383 questions

SE-Radio Episode 242: Dave Thomas on Innovating Legacy Systems
Answers 383 questions

SE-Radio Episode 279: Florian Gilcher on Rust
Answers 383 questions

SE-Radio Episode 276: Björn Rabenstein on Site Reliability Engineering
Answers 383 questions

SE-Radio-Episode-253-Fred-George-on-Developer-Anarchy
Answers 383 questions

SE-Radio Episode 247: Andrew Phillips on DevOps
Answers 383 questions

SE-Radio-Episode-267-Jürgen-Höller-on-Reactive-Spring-and-Spring-5.0
Answers 383 questions

SE-Radio Episode 313: Conor Delanbanque on Hiring and Retaining DevOps
Answers 383 questions

SE-Radio Episode 243: RethinkDB with Slava Akhmechet
Answers 383 questions

SE-Radio Episode 357: Adam Barr on Code Quality
Answers 383 questions

SE-Radio Episode 362: Simon Riggs on Advanced Features of PostgreSQL
Answers 383 questions














