RailsConf 2008: Some Fuzed Notes

If we can land humans on Mars, there's no reason we can't make a fast Ruby.

No matter how fast a Ruby we make, we're always going to need a way to scale it!

Traditional Scaling

  1. Single mongrel
  2. Internet -> nginx -> many mongrels
  3. Internet -> nginx -> many boxes -> many mongrels
  4. Internet -> load balancer -> many nginx -> many boxes -> many mongrels

What happens if a machine fails?

Have to monitor all of them. A: It will automatically be taken out of rotation.

What happens if you need to add more hardware fast?

Lot of steps with this traditional setup. A: No configuration changes necessary. Just add more nodes.

What happens if you have a mixture of very fast and very slow pages?

Nginx doesn't know the status of your mongrels - could be queueing to busy mongrel. Fuzed uses "next available resource" queueing. Not a problem.

What do you do about a staging setup?

A: Run multiple app versions of your app in the same cloud. Tell it which one to dispatch to.

How do you deal with scaling in a flexible cloud (like EC2)?

A: Please. Fuzed was MADE for dynamic cloud environment. Use Bonjour and DNS.

What happens if you change your environment (e.g., from EC2 to a colo faccility)?

A: Change a few hostnames in startup commands.

Cluster Before Our Eyes

(Guy who made Chronic)

Rails running on Rack, talking directly to Erlang.

How are three commands better than one?

Another node joins the cluster remotely. Multi-headed app.

Rails node on both machines - registered into the same cluster. Two front-ends, two back-ends, single master. Balancer is balancing between two back-ends.

Unregisters fron-end and backend. Self-assembles. Stuff gets routed to available node.

Multiple nodes running on single machine now. Four nodes total. Kills one of the processes. Fuze restarts the process.

Fuze is self-healing. Has a very robust failover notion.

Halt is run on one of the nodes. Wipes out the VM, node is removed immediately.

Rails app has access to cluster information. Knows how many workers and pools it has or should have.

Fuze Awesomeness (See answers)

Insanely Flexible

Cloud of machines.

  1. Pick one of them. You are the master node.
  2. Pick some machines to become the faceplates. Load-balance into the faceplates. Gives static, and is portal to dynamics.
  3. Pick some for workers. These are your Rails nodes, and are available to serve requests. Parallel scalability Able to fatten the front-end pipe. If your workers are the bottleneck, add more workers.

Things Fuzed Does Not Help You With

  1. Scaling your Database. (Bummer dude!)
  2. Raw Speed (slower than raw, faster than pre-evented mongrel) - focused on scaling horizontally.

...