We've been optimising and tweaking various things... Some of the last things we tried involve some technicalities of LiveView and OTP, we've added some ENV variables for instances to be able to tweak, and set some default values that seem to make sense so far:

  • LV_TIMEOUT: 42 seconds. The timeout for keeping websocket connections open after it last received data.
  • LV_HIBERNATE_AFTER: 7 seconds. The time of inactivity allowed in the LiveView before compressing its own memory and state.
  • LV_FULLSWEEP_AFTER: 20. The maximum number of garbage collections before forcing a fullsweep for the socket process. You can set it to 0 to force more frequent clean-ups of your websocket transport processes.