Visualizers

Learn by moving things

Interactive explainers for the ideas behind retrieval, embeddings, and agents. A formula tells you what is true; dragging a vector shows you why. Each one also appears inside the article it belongs to, and runs entirely in your browser, so drag, poke, and break it.

Portrait of Sachin Gupta rendered in binary

Send to the server answering fastest right now, so traffic steers away from a struggling server even before it fails a health check. Needs constant latency measurement.

least response timedynamicauto
request#0load balancerleast response timeserver 145 msserver 295 msserver 365 ms

Least response time: send to the server answering fastest right now. It naturally steers away from a slow or struggling server.

The modern default: do not check every server, pick two at random and send to the less busy one. Almost the evenness of checking everyone, for almost none of the cost, and it avoids the herd.

power of two choicesdynamicauto
request#0load balancerpower of two choicesserver 124 connsserver 248 connsserver 38 conns

Power of two choices: pick two servers at random, then send to the less busy of the two. Almost as good as checking them all, at a fraction of the cost.

Hash the client's IP to pick a server, so a given client always lands on the same one. No cookie, works at layer 4. Watch out for many clients behind one address.

Source-IP hash: same client, same serverauto
client IP1.2.3.4hashto a fixed serverserver 1server 2server 3

Hash the client's IP to pick a server, so a given client always lands on the same one. No cookie needed, and it works at layer 4.

Visualizers — Sachin Gupta