Last time we did some simple Phoenix performance tweaks to make the homepage performant enough to handle over a thousand requests per second.
But on pages that do significant numbers of database queries, we need something more.
An OTP in-memory data store (6:02)
The greatest thing about Elixir is all the Erlang and OTP tools we get automatically. Here's a look at how to use Erlang Term Storage to cache database requests and improve Phoenix's already impressive performance.
The Episodes page is now sped up to 275 requests a second on a $5/month server.
Note that this app is compiling Markdown inline and has some other CMS-like features. With just standard EEx templates, performance is around 1k requests per second. Instead of demoing something built specifically to win on a benchmark, the goal here was to show a real-world app with shortcuts taken for the sake of productivity and see how it could do on a bottom-tier VPS offering.
Update: There was a thread about this video on elixirforum.com, so I made another video as a response to community feedback.