Simon Willison’s Weblog

Subscribe
Atom feed for load-balancing

13 items tagged “load-balancing”

2024

Load Balancing. Sam Rose built this interactive essay explaining how different load balancing strategies work. It's part of a series that includes memory allocation, bloom filters and more.

# 13th July 2024, 10:51 pm / explorables, algorithms, load-balancing, sam-rose

The power of two random choices, visualized. Grant Slatton shares a visualization illustrating “a favorite load balancing technique at AWS”: pick two nodes at random and then send the task to whichever of those two has the lowest current load score.

Why just two nodes? “The function grows logarithmically, so it’s a big jump from 1 to 2 and then tapers off *real* quick.”

# 6th February 2024, 10:21 pm / scaling, aws, load-balancing

2019

Scaling React Server-Side Rendering (via) Outstanding, detailed essay from 2017 on challenges and solutions for scaling React server-side rendering at Kijiji, Canada’s largest classified site (owned by eBay). There’s a lot of great stuff in here, including a detailed discussion of different approaches to load balancing, load shedding, component caching, client-side rendering fallbacks and more.

# 30th December 2019, 10:26 pm / scaling, react, load-balancing

2009

Round-robin Django setup with nginx. An nginx trick I didn’t know: a low proxy_connect_timeout value (e.g. 2 seconds) combined with the proxy_next_upstream setting means that if one of your backends breaks a user won’t even see an error, they’ll just have a short delay before getting a response from a working server.

# 21st December 2009, 3:43 pm / django, load-balancing, nginx, ops, sysadmin

Simple CouchDB multi-master clustering via Nginx. An impressive combination. CouchDB can be easily set up in a multi-master configuration, where writes to one master are replicated to the other and vice versa. This makes setting up a reliable CouchDB cluster is as simple as putting two such servers behind a single nginx proxy.

# 19th November 2009, 4:37 pm / nginx, couchdb, cluster, load-balancing, multimaster, replication

I loathe [hardware load balancers]. They’re expensive, restrictive, slow, and generally cause you a lot more pain and suffering than they’re worth. At my last job, one of my projects was to convert most of one of our existing clusters from a load-balancing appliance to use keepalived. Why would we do this? Because the $100k worth of appliance wasn’t capable of doing the job that $15k worth of commodity hardware and an installation of keepalived were handling with ease.

Matt Palmer

# 3rd November 2009, 10:45 am / keepalived, load-balancing, matt-palmer, ops, sysadmin

Load Balancing in Amazon EC2 with HAProxy. Solid tutorial introduction to HAProxy.

# 5th February 2009, 11:12 pm / ec2, haproxy, load-balancing, griggheorghiu

2008

Minimal nginx conf to split get/post requests. Interesting idea for master-slave replication balancing where GET v.s. POST is load-balanced by nginx, presumably to different backend servers that are configured to talk to either a slave or a master. This won’t deal very will with replication lag though—you really want a user’s session to be bound to the master server for the next few GET requests after data is modified to ensure they see the effects of their updates. UPDATE: Amit fixed my complaint with a neat hack based around a cookie with a max age of 10 seconds.

# 14th October 2008, 4:33 pm / load-balancing, masterslave, mysql, nginx, replication

mod_rpaf for Apache. A more secure alternative to Django’s equivalent middleware: sets the REMOTE_ADDR of incoming requests from whitelisted load balancers to the X-Forwarded-For header, without any risk that if the load balancers are missing attackers could abuse it to spoof their IP addresses.

# 24th June 2008, 5:02 pm / django, middleware, apache, rpaf, modrpaf, security, xforwardedfor, http, load-balancing

Scaling your website with the Perlbal web server (PDF) (via) Perlbal documentation is pretty thin on the ground; this is a really useful introduction from Frank Wiles.

# 17th June 2008, 10:39 pm / frank-wiles, load-balancing, perlbal, pdf

Load Balancer Update. WordPress.com has switched from Pound to nginx for load balancing, resulting in a significant drop in CPU usage. I’ve been using nginx on my little VPS for over a year now with no complaints, nice to know it scales up as well as down.

# 1st May 2008, 10:06 am / nginx, load-balancing, pound, wordpress, wordpresscom

2007

A Fair Proxy Balancer for Nginx and Mongrel. nginx uses round robin for proxying by default; this extension module ensures requests are queued up and sent through to backend mongrel servers that aren’t currently busy. I don’t see any reason this wouldn’t work with servers other than mongrel.

# 9th December 2007, 2:57 pm / mongrel, nginx, proxy, load-balancing, fair

Client Side Load Balancing for Web 2.0 Applications (via) I recall that early versions of Netscape picked a random server from a hard-coded list each time a user clicked the “What’s New” button, back before server-side scaling techniques were well understood.

# 5th October 2007, 11:29 pm / scaling, load-balancing, sitepoint, digitalweb, leizhu, netscape