Published Sep 3, 2019

SE-Radio Episode 349: Gary Rennie on Phoenix

Gary Rennie delves into the Phoenix framework, highlighting its powerful ecosystem, real-time capabilities, and optimization strategies, while offering valuable insights on the Ecto database tool for efficient web app development and deployment.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

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