Home

Awesome

Paxuby

Paxos algorithm in Ruby

Introduction

The Paxos algorithm is a cornerstone in building distributed, fault-tolerant storage systems. Notable real world applications include Chubby, Google's lock managing system that serves the Google Filesystem(GFS) and Gaios, Microsoft's replicated datastore. Regardless of its backend, under the assumption that only less than half of a system's instances may encouter failures, Paxos guarantees that:

Besides the above guarantess, this particular implementation aims at providing:

Usage

Assuming you are using the default key-value backend,

Interface between paxuby and backends

The main interface lies in the App module. Custom backends can be supported by implementing:

A straight forward example can be found in './app/app.rb'.

Testing and Profiling

Performance

The results of ruby test/perf.rb for the response time is 7.5ms for the 50th percentil, 24ms for the 90th, but 600ms for the 99th. The below charts show the distribution (note that we omited the long tail which is actually important in real world applications) and the results of gperftools for the leader and replicas (wallclock time): response time histogram leader perf replica perf

Config options

We read the configs from 'config.yaml' in YAML format:

addrs:
  - 127.0.0.1:6660
  - 127.0.0.1:6661
  - 127.0.0.1:6662
heartbeat_timeout: 0.75 # time for replicas to check whether leader is alive, in seconds
perftools: false # enable gperftools profiling

License

Copyright 2013 Awaw Fumin awawfumin@gmail.com
Licensed under GNU Affero General Public License v3

Todos