ZooKeeper - wait free protocol for coordinating processes

21
ZooKeeper Iuliia Proskurnia, Zygimantas Bruzgys

description

ZooKeeper is a service for coordinating processes within distributed systems. Stress test of the tool was applied. Reliable Multicast and Dynamic LogBack system Configuration management were implemented with ZooKeeper. More details: http://proskurnia.in.ua/wiki/zookeeper_research

Transcript of ZooKeeper - wait free protocol for coordinating processes

Page 1: ZooKeeper - wait free protocol for coordinating processes

ZooKeeperIuliia Proskurnia, Zygimantas Bruzgys

Page 2: ZooKeeper - wait free protocol for coordinating processes

Outline

• ZooKeeper?

• ZooKeeper Service

• ZooKeeper Usage

• Key Points

• Installation

• Experiments

• Configuration

• Reliable Multicast

• Stress Test

• Conclusions

2

Page 3: ZooKeeper - wait free protocol for coordinating processes

Key features

ZooKeeper is:

•Service for coordinating processes in distributed applications.

•Key/value table.

•No locks service.

3

Features are:

•High Throughput

•Low Latency

•Highly Available

•Strictly ordered access to the nodes

Page 4: ZooKeeper - wait free protocol for coordinating processes

Architecture4

Page 5: ZooKeeper - wait free protocol for coordinating processes

ZooKeeper Service

• Znodes

• Regular & Ephemeral

• Watches

• Synchronous and Asynchronous methods

• Guarantees:

• Linearizable writes

• FIFO client order

• Handling shared configuration updates

• Liveness and durability

5

Page 6: ZooKeeper - wait free protocol for coordinating processes

ZooKeeper Usage

• Configuration Management

• Group membership

• Leader Election

• Simple Locks

• Simple Locks without Herd Effect

• Read/Write Locks

• Double Barrier

6

Page 7: ZooKeeper - wait free protocol for coordinating processes

Key Points

• Wait-free protocol

• No Locks

• Support Applications:

• Configuration Management

• Leader Election

• Group Membership

7

• But...

• State Based System

• Last changes visible

• Limited total size of data

Page 8: ZooKeeper - wait free protocol for coordinating processes

Installation

8

Sample Configuration File:tickTime=2000initLimit=10syncLimit=5clientPort=2181dataDir=/home/ubuntu/zoodata

server.1=10.227.206.23:2888:3888server.2=10.58.190.233:2888:3888server.3=10.234.121.38:2888:3888

To install you need to:•Install Java•Download and extract ZooKeeper•Write a configuration file•Write node ID in data directory (filename myid)•Start ZooKeeper

Page 9: ZooKeeper - wait free protocol for coordinating processes

Experiments9

Page 10: ZooKeeper - wait free protocol for coordinating processes

Configuration Management

10

Page 11: ZooKeeper - wait free protocol for coordinating processes

Reliable Multicast: Main

11

Page 12: ZooKeeper - wait free protocol for coordinating processes

Reliable Multicast: Leader Election

12

Page 13: ZooKeeper - wait free protocol for coordinating processes

Reliable Multicast:Send Message

13

Page 14: ZooKeeper - wait free protocol for coordinating processes

Reliable Multicast: Receive Message

14

Page 15: ZooKeeper - wait free protocol for coordinating processes

Reliable Multicast:Interesting Cases

15

• New client connects while a message is multicasted

• Recipient fails before receiving a message

• Leader fails

Page 16: ZooKeeper - wait free protocol for coordinating processes

Stress Tests

• Done with zk-latencies Python script

• Run with the following configuration

16

./zk-latencies.py --servers "CONNECTION_STRING" --znode_count=ZNODE_COUNT \--znode_size=100 --timeout=5000 --watch_multiple=2

Page 17: ZooKeeper - wait free protocol for coordinating processes

Stress Tests

17

0"

2000"

4000"

6000"

8000"

10000"

12000"

14000"

1" 2" 3" 4" 5"

ms#

Number#of#Servers#in#ZooKeeper#Cluster#

Time#for#10.000#Async#Opera>ons#

Read"

Write"

Watch"

1 client,multiple servers

Page 18: ZooKeeper - wait free protocol for coordinating processes

Stress Tests

18

0"

1"

2"

3"

4"

5"

6"

7"

1" 2" 3" 4"

ms/op

era)

on+

Number+of+Servers+in+ZooKeeper+Cluster+

Synchronous+Opera)ons+

Read"

Write"

Watch"

1 client,multiple servers

Page 19: ZooKeeper - wait free protocol for coordinating processes

Stress Tests

19

5 servers,1 client

0"

0,2"

0,4"

0,6"

0,8"

1"

1,2"

1" 2" 4" 6" 8" 10" 12" 14" 16"

ms/op

era)

on+

Thousands+of+Async+Opera)ons+

Writes+per+ms+

Page 20: ZooKeeper - wait free protocol for coordinating processes

Conclusions

20

• ZooKeeper is:

• Coordination Service

• Highly Available

• Low Latency

• Wait-Free

• We Showed Several Examples:

• Configuration Management

• Reliable Multicast

• Stress Tests Shows:

• Prefer more servers for high availability and higher reads/write ratio

• With more servers it is still low latency

Page 21: ZooKeeper - wait free protocol for coordinating processes

ZooKeeperIuliia Proskurnia, Zygimantas Bruzgys