🧀 BigCheese.ai

Social

WebSockets cost us $1M on our AWS bill

🧀

Recall.ai encountered unexpectedly high AWS bills due to inefficient use of WebSockets for inter-process communication (IPC) in transferring high-bandwidth video data. Profiling revealed that most CPU time was spent in memory copy functions. After analysis, Recall.ai replaced WebSockets with a custom shared memory implementation using a ring buffer, cutting CPU usage by 50% and saving over $1M/year.

  • WebSockets contributed to high AWS billing.
  • Memmove and Memcpy were CPU-heavy.
  • Video data transport needed optimization.
  • Ring buffer improved data transport efficiency.
  • Shared memory replaced WebSockets, cutting costs.