Sefaria's Eighth Plague
The best engineering goes unnoticed. Ideally, a website runs so perfectly that users never have to wonder what is going on behind the scenes. Over the past few weeks, Sefaria's engineers have been working to create just that by speeding up the server at the core. Specifically, Sefaria is migrating the site from a single server to a multi-server architecture that allows us to trigger additional resources on demand.
That way, when the site begins to slow as users access it in greater and growing numbers, we can automatically tap these resources, scaling them up and down according to traffic.
And how do we test these servers? What do we use to mimic the swarms of users that descend upon Sefaria every day, hungry for learning?
Locusts, of course! The eighth plague.
That is to say, Sefaria's engineers deploy testing tools called locusts to test what the site can handle. Each locust mimics user behavior. They go from page to page, devouring texts, hopping onto connections, buzzing in the source sheets, and so on. Each is busy with their own script.
A single locust does no damage.
Thousands at a time? Similar to real users, they unintentionally slow the site down.
During our largest test yet, we sent 5,000 locusts to the site simultaneously and watched it falter — until the multi-server architecture deployed additional resources to assume some of the burden.
Going forward, users should notice a faster, smoother Sefaria experience. Or, even better — they won't notice it at all.