Load Testing LiveView with a Dynamic Supervisor and some Genservers

I used a Dynamic Supervisor to spawn a bunch of GenServers that are running a copy/paste of my LiveView code.

Here is a demo on YouTube

This gave me a hard theoretical maximum number of users I could handle on a given amount of CPU, it also gives me a way to see if a performance optimization actually worked.

However, I’m sure there is some overhead in the LiveView framework for authenticating Websockets, generating CSRF tokens, and generating the diff for the dom.

I’m curious to hear suggestions for how I could add some of that overhead to my load-test without actually starting up a bunch of browsers.

I’m also curious to hear if someone has an educated guess around how much CPU the Websocket connections and CSRF tokens consume on their own, has anyone done some testing around connecting large amounts of browsers to a LiveView app that basically does nothing?