apache cassandra in bangalore - cassandra internals and performance

122
BANGALORE CASSANDRA UG APRIL 2013 CASSANDRA INTERNALS & PERFORMANCE Aaron Morton @aaronmorton www.thelastpickle.com Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License

Upload: aaronmorton

Post on 01-Dec-2014

1.082 views

Category:

Technology


2 download

DESCRIPTION

Slides from http://www.meetup.com/Apache-Cassandra/events/108524582/

TRANSCRIPT

Page 1: Apache Cassandra in Bangalore - Cassandra Internals and Performance

BANGALORE CASSANDRA UG APRIL 2013

CASSANDRA INTERNALS & PERFORMANCE

Aaron Morton@aaronmorton

www.thelastpickle.com

Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License

Page 2: Apache Cassandra in Bangalore - Cassandra Internals and Performance

ArchitectureCode

Page 3: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Cassandra Architecture

API's

Cluster Aware

Cluster Unaware

Clients

Disk

Page 4: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Cassandra Cluster Architecture

API's

Cluster Aware

Cluster Unaware

Clients

Disk

API's

Cluster Aware

Cluster Unaware

Disk

Node 1 Node 2

Page 5: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Dynamo Cluster Architecture

API's

Dynamo

Database

Clients

Disk

API's

Dynamo

Database

Disk

Node 1 Node 2

Page 6: Apache Cassandra in Bangalore - Cassandra Internals and Performance

ArchitectureAPI

DynamoDatabase

Page 7: Apache Cassandra in Bangalore - Cassandra Internals and Performance

API Transports

ThriftNative Binary

Read LineRMI

Page 8: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Thrift Transport

//Custom TServer implementations

o.a.c.thrift.CustomTThreadPoolServero.a.c.thrift.CustomTNonBlockingServero.a.c.thrift.CustomTHsHaServer

Page 9: Apache Cassandra in Bangalore - Cassandra Internals and Performance

API Transports

ThriftNative Binary

Read LineRMI

Page 10: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Native Binary Transport

Beta in Cassandra 1.2Uses Netty 3.5Enabled with

start_native_transport(Disabled by default)

Page 11: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.transport.Server.run()

//Setup the Netty servernew ExecutionHandler()new NioServerSocketChannelFactory()ServerBootstrap.setPipelineFactory()

Page 12: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.transport.Message.Dispatcher.messageReceived()

//Process message from clientServerConnection.validateNewMessage()Request.execute()ServerConnection.applyStateTransition()Channel.write()

Page 13: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.transport.messages

CredentialsMessage()EventMessage()ExecuteMessage()PrepareMessage()QueryMessage()ResultMessage()

(And more...)

Page 14: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Messages

Defined in the Native Binary Protocol

$SRC/doc/native_protocol.spec

Page 15: Apache Cassandra in Bangalore - Cassandra Internals and Performance

API Services

JMXCLI

ThriftCQL 3

Page 16: Apache Cassandra in Bangalore - Cassandra Internals and Performance

JMX Management Beans

Spread around the code base.

Interfaces named *MBean

Page 17: Apache Cassandra in Bangalore - Cassandra Internals and Performance

JMX Management Beans

Registered with the names such as

org.apache.cassandra.db:type=StorageProxy

Page 18: Apache Cassandra in Bangalore - Cassandra Internals and Performance

API Services

JMXCLI

ThriftCQL 3

Page 19: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.cli.CliMain.main()

// Connect to server to read inputthis.connect()this.evaluateFileStatements()this.processStatementInteractive()

Page 20: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CLI Grammar

ANTLR Grammar$SRC/src/java/o/a/c/cli/CLI.g

Page 21: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.cli.CliClient.executeCLIStatement()

// Process statementCliCompiler.compileQuery() #ANTLRswitch (tree.getType()) case...

Page 22: Apache Cassandra in Bangalore - Cassandra Internals and Performance

API Services

JMXCLI

ThriftCQL 3

Page 23: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.thrift.CassandraServer

// Implements Thrift Interface// Access control// Input validation// Mapping to/from Thrift and internal types

Page 24: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Thrift Interface

Thrift IDL$SRC/interface/cassandra.thrift

Page 25: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.thrift.CassandraServer.get_slice()

// get columns for one rowTracing.begin()ClientState cState = state()cState.hasColumnFamilyAccess()multigetSliceInternal()

Page 26: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CassandraServer.multigetSliceInternal()

// get columns for may rowsThriftValidation.validate*()// Create ReadCommandsgetSlice()

Page 27: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CassandraServer.getSlice()

// Process ReadCommands// return Thrift types

readColumnFamily()thriftifyColumnFamily()

Page 28: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CassandraServer.readColumnFamily()

// Process ReadCommands// Return ColumnFamilies

StorageProxy.read()

Page 29: Apache Cassandra in Bangalore - Cassandra Internals and Performance

API Services

JMXCLI

ThriftCQL 3

Page 30: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.cql3.QueryProcessor

// Prepares and executes CQL3 statements// Used by Thrift & Native transports// Access control// Input validation// Returns transport.ResultMessage

Page 31: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CQL3 Grammar

ANTLR Grammar$SRC/o.a.c.cql3/Cql.g

Page 32: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.cql3.statements.ParsedStatement

// Subclasses generated by ANTLR// Tracks bound term count// Prepare CQLStatementprepare()

Page 33: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.cql3.statements.CQLStatement

checkAccess(ClientState state)validate(ClientState state)execute(ConsistencyLevel cl, QueryState state, List<ByteBuffer> variables)

Page 34: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.cql3.functions.Function

argsType()returnType()execute(List<ByteBuffer> parameters)

Page 35: Apache Cassandra in Bangalore - Cassandra Internals and Performance

statements.SelectStatement.RawStatement

// Implements ParsedStatement// Input validationprepare()

Page 36: Apache Cassandra in Bangalore - Cassandra Internals and Performance

statements.SelectStatement.execute()

// Create ReadCommandsStorageProxy.read()

Page 37: Apache Cassandra in Bangalore - Cassandra Internals and Performance

ArchitectureAPI

DynamoDatabase

Page 38: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Dynamo Layero.a.c.service

o.a.c.neto.a.c.dht

o.a.c.locatoro.a.c.gms

o.a.c.stream

Page 39: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.service.StorageProxy

// Cluster wide storage operations// Select endpoints & check CL available// Send messages to Stages// Wait for response// Store Hints

Page 40: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.service.StorageService

// Ring operations// Track ring state// Start & stop ring membership// Node & token queries

Page 41: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.service.IResponseResolver

preprocess(MessageIn<T> message)resolve() throws DigestMismatchException

RowDigestResolverRowDataResolverRangeSliceResponseResolver

Page 42: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Response Handlers / Callback

implements IAsyncCallback<T>

response(MessageIn<T> msg)

Page 43: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.service.ReadCallback.get()

//Wait for blockfor & datacondition.await(timeout, TimeUnit.MILLISECONDS)

throw ReadTimeoutException()

resolver.resolve()

Page 44: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.service.StorageProxy.fetchRows()

getLiveSortedEndpoints()new RowDigestResolver()new ReadCallback()MessagingService.sendRR()---------------------------------------ReadCallback.get() # blockingcatch (DigestMismatchException ex)catch (ReadTimeoutException ex)

Page 45: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Dynamo Layero.a.c.service

o.a.c.neto.a.c.dht

o.a.c.locatoro.a.c.gms

o.a.c.stream

Page 46: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.net.MessagingService.verb<<enum>>

MUTATIONREADREQUEST_RESPONSETREE_REQUESTTREE_RESPONSE

(And more...)

Page 47: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.net.MessagingService.verbHandlers

new EnumMap<Verb, IVerbHandler>(Verb.class)

Page 48: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.net.IVerbHandler<T>

doVerb(MessageIn<T> message, String id);

Page 49: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.net.MessagingService.verbStages

new EnumMap<MessagingService.Verb, Stage>(MessagingService.Verb.class)

Page 50: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.net.MessagingService.receive()

runnable = new MessageDeliveryTask( message, id, timestamp);

StageManager.getStage( message.getMessageType());

stage.execute(runnable);

Page 51: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.net.MessageDeliveryTask.run()

// If dropable and rpc_timeoutMessagingService.incrementDroppedMessag

es(verb);

MessagingService.getVerbHandler(verb)verbHandler.doVerb(message, id)

Page 52: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Dynamo Layero.a.c.service

o.a.c.neto.a.c.dht

o.a.c.locatoro.a.c.gms

o.a.c.stream

Page 53: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.dht.IPartitioner<T extends Token>

getToken(ByteBuffer key)getRandomToken()

LocalPartitionerRandomPartitionerMurmur3Partitioner

Page 54: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.dht.Token<T>

compareTo(Token<T> o)

BytesTokenBigIntegerTokenLongToken

Page 55: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Dynamo Layero.a.c.service

o.a.c.neto.a.c.dht

o.a.c.locatoro.a.c.gms

o.a.c.stream

Page 56: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.locator.IEndpointSnitch

getRack(InetAddress endpoint)getDatacenter(InetAddress endpoint)sortByProximity(InetAddress address,

List<InetAddress> addresses)

SimpleSnitchPropertyFileSnitchEc2MultiRegionSnitch

Page 57: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.locator.AbstractReplicationStrategy

getNaturalEndpoints( RingPosition searchPosition)calculateNaturalEndpoints(Token searchToken, TokenMetadata tokenMetadata)

SimpleStrategyNetworkTopologyStrategy

Page 58: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.locator.TokenMetadata

BiMultiValMap<Token, InetAddress> tokenToEndpointMapBiMultiValMap<Token, InetAddress> bootstrapTokensSet<InetAddress> leavingEndpoints

Page 59: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Dynamo Layero.a.c.service

o.a.c.neto.a.c.dht

o.a.c.locatoro.a.c.gms

o.a.c.stream

Page 60: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.gms.VersionedValue

// VersionGenerator.getNextVersion()

public final int version;public final String value;

Page 61: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.gms.ApplicationState<<enum>>

STATUSLOADSCHEMADCRACK

(And more...)

Page 62: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.gms.HeartBeatState

//VersionGenerator.getNextVersion();

private int generation;private int version;

Page 63: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.gms.Gossiper.GossipTask.run()

// SYN -> ACK -> ACK2makeRandomGossipDigest()new GossipDigestSyn()

// Use MessagingService.sendOneWay()Gossiper.doGossipToLiveMember()Gossiper.doGossipToUnreachableMember()Gossiper.doGossipToSeed()

Page 64: Apache Cassandra in Bangalore - Cassandra Internals and Performance

gms.GossipDigestSynVerbHandler.doVerb()

Gossiper.examineGossiper()new GossipDigestAck()MessagingService.sendOneWay()

Page 65: Apache Cassandra in Bangalore - Cassandra Internals and Performance

gms.GossipDigestAckVerbHandler.doVerb()

Gossiper.notifyFailureDetector()Gossiper.applyStateLocally()Gossiper.makeGossipDigestAck2Message()

Page 66: Apache Cassandra in Bangalore - Cassandra Internals and Performance

gms.GossipDigestAcksVerbHandler.doVerb()

Gossiper.notifyFailureDetector()Gossiper.applyStateLocally()

Page 67: Apache Cassandra in Bangalore - Cassandra Internals and Performance

ArchitectureAPI Layer

Dynamo LayerDatabase Layer

Page 68: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Database Layero.a.c.concurrent

o.a.c.db

o.a.c.cacheo.a.c.io

o.a.c.trace

Page 69: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.concurrent.StageManager

stages = new EnumMap<Stage, ThreadPoolExecutor>(Stage.class);

getStage(Stage stage)

Page 70: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.concurrent.Stage

READMUTATIONGOSSIPREQUEST_RESPONSEANTI_ENTROPY

(And more...)

Page 71: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Database Layero.a.c.concurrent

o.a.c.db

o.a.c.cacheo.a.c.io

o.a.c.trace

Page 72: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.db.Table

// Keyspaceopen(String table)getColumnFamilyStore(String cfName)

getRow(QueryFilter filter)apply(RowMutation mutation, boolean writeCommitLog)

Page 73: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.db.ColumnFamilyStore

// Column FamilygetColumnFamily(QueryFilter filter)getTopLevelColumns(...)

apply(DecoratedKey key, ColumnFamily columnFamily, SecondaryIndexManager.Updater indexer)

Page 74: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.db.IColumnContainer

addColumn(IColumn column)remove(ByteBuffer columnName)

ColumnFamilySuperColumn

Page 75: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.db.ISortedColumns

addColumn(IColumn column, Allocator allocator)removeColumn(ByteBuffer name)

ArrayBackedSortedColumnsAtomicSortedColumnsTreeMapBackedSortedColumns

Page 76: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.db.Memtable

put(DecoratedKey key, ColumnFamily columnFamily, SecondaryIndexManager.Updater indexer)

flushAndSignal(CountDownLatch latch, Future<ReplayPosition> context)

Page 77: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Memtable.FlushRunnable.writeSortedContents()

// SSTableWritercreateFlushWriter()

// Iterate through rows & CF’s in orderwriter.append()

Page 78: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.db.ReadCommand

getRow(Table table)

SliceByNamesReadCommandSliceFromReadCommand

Page 79: Apache Cassandra in Bangalore - Cassandra Internals and Performance

o.a.c.db.IDiskAtomFilter

getMemtableColumnIterator(...)getSSTableColumnIterator(...)

IdentityQueryFilterNamesQueryFilterSliceQueryFilter

Page 80: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Some query performance...

Page 81: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Today.

Write PathRead Path

Page 82: Apache Cassandra in Bangalore - Cassandra Internals and Performance

memtable_flush_queue_size test...

m1.xlarge Cassandra nodem1.xlarge client node

1 CF with 6 Secondary Indexes1 Client Thread

10,000 Inserts, 100 Columns per Row1100 bytes per Column

Page 83: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF write latency and memtable_flush_queue_size...

0

300

600

900

1,200

85th 95th 99th 100th

Late

ncy

Micr

osec

onds

memtable_flush_queue_size=7 memtable_flush_queue_size=1

Page 84: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency and memtable_flush_queue_size...

0

1,250,000

2,500,000

3,750,000

5,000,000

85th 95th 99th 100th

Late

cy M

icros

econ

ds

memtable_flush_queue_size=7 memtable_flush_queue_size=1

Page 85: Apache Cassandra in Bangalore - Cassandra Internals and Performance

durable_writes test...

10,000 Inserts, 50 Columns per Row50 bytes per Column

Page 86: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency and durable_writes (1 client)...

0

1,750

3,500

5,250

7,000

85th 95th 99th

Late

ncy

Micr

osec

onds

enabled disabled

Page 87: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency and durable_writes (10 clients)...

0

7,500

15,000

22,500

30,000

85th 95th 99th

Late

ncy

Micr

osec

onds

enabled disabled

Page 88: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency and durable_writes (20 clients)...

0

22,500

45,000

67,500

90,000

85th 95th 99th

Late

ncy

Micr

osec

onds

enabled disabled

Page 89: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CommitLog tests...

10,000 Inserts, 50 Columns per Row50 bytes per Column

Page 90: Apache Cassandra in Bangalore - Cassandra Internals and Performance

periodic commit log adds mutation to queue then acknowledges.

Commit Log is appended to by a single thread, sync is called every

commitlog_sync_period_in_ms.

Page 91: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency and commitlog_sync_period_in_ms...

170

183

195

208

220

85th 95th 99th

Late

cy M

icros

econ

ds

10,000 ms 10 ms

Page 92: Apache Cassandra in Bangalore - Cassandra Internals and Performance

batch commit log adds mutation to queue and waits before acknowledging.

Writer thread processes mutations for commitlog_sync_batch_window_in_

ms duration, then syncs, then signals.

Page 93: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency comparing periodic and batch sync...

0

200

400

600

800

85th 95th 99th

Late

cy M

icros

econ

ds

periodic batch

Page 94: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Merge mutation...

Row level Isolation provided via SnapTree.

(https://github.com/nbronson/snaptree)

Page 95: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Row concurrency tests...

10,000 Columns per Row50 bytes per Column

50 Columns per Insert

Page 96: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF Write Latency and row concurrency (10 clients)...

0

500

1,000

1,500

2,000

85th 95th 99th

Late

cy M

icros

econ

ds

different rows single row

Page 97: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Secondary Indexes...

synchronized access to indexed rows.

(Keyspace wide)

Page 98: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Index concurrency tests...

CF with 2 Indexes10,000 Inserts

6 Columns per Row35 bytes per Column

Alternating column values

Page 99: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency and index concurrency (10 clients)...

0

1,000

2,000

3,000

4,000

85th 95th 99th

Late

cy M

icros

econ

ds

different rows single row

Page 100: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Index tests...

10,000 Inserts50 Columns per Row50 bytes per Column

Page 101: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Request latency and secondary indexes...

0

750

1,500

2,250

3,000

85th 95th 99th

Late

cy M

icros

econ

ds

no indexes six indexes

Page 102: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Today

Write PathRead Path

Page 103: Apache Cassandra in Bangalore - Cassandra Internals and Performance

bloom_filter_fp_chance tests...1,000,000 Rows

50 Columns per Row50 bytes per Column

commitlog_total_space_in_mb: 1

Read random 10% of rows.

Page 104: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and bloom_filter_fp_chance...

0

1,750

3,500

5,250

7,000

85th 95th 99th

Late

cy M

icros

econ

ds

default 0.000744. 0.1

Page 105: Apache Cassandra in Bangalore - Cassandra Internals and Performance

key_cache_size_in_mb tests...

10,000 Rows50 Columns per Row50 bytes per Column

Read all Rows

Page 106: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and key_cache_size_in_mb...

0

75

150

225

300

85th 95th 99th

Late

cy M

icros

econ

ds

default (100MB) 100% Hit Rate disabled

Page 107: Apache Cassandra in Bangalore - Cassandra Internals and Performance

index_interval tests...100,000 Rows

50 Columns per Row50 bytes per Column

key_cache_size_in_mb: 0

Read 1 Column from random 10% of Rows

Page 108: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and index_interval...

0

5,000

10,000

15,000

20,000

85th 95th 99th

Late

cy M

icros

econ

ds

index_interval=128 (default) index_interval=512

Page 109: Apache Cassandra in Bangalore - Cassandra Internals and Performance

row_cache_size_in_mb tests...

100,000 Rows50 Columns per Row50 bytes per Column

Read all Rows

Page 110: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and row_cache_size_in_mb...

0

65

130

195

260

85th 95th 99th

Late

cy M

icros

econ

ds

row_cache_size_in_mb=0 and key_cache_size_in_mb=100mbrow_cache_size_in_mb=100mb and key_cache_size_in_mb=0

Page 111: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Column Index tests...

Read first Column by name from 1,200 Columns.

Read first Column by name from 1,000,000

Columns.

Page 112: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and Column Index...

0

1,500

3,000

4,500

6,000

85th 95th 99th

Late

cy M

icros

econ

ds

First Column from 1,200 First Column from 1,000,000

Page 113: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Name Locality tests...1,000,000 Columns

50 bytes per Column

Read 100 Columns from middle of row.Read 100 Columns from spread across row.

Page 114: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and name locality...

0

50,000

100,000

150,000

200,000

85th 95th 99th

Late

cy M

icros

econ

ds

Adjacent Columns Spread Columns

Page 115: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Start position tests...1,000,000 Columns

50 bytes per Column

Read first 100 Columns without start.Read first 100 Columns with start.

Page 116: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and start position...

0

10,000

20,000

30,000

40,000

85th 95th 99th

Late

cy M

icros

econ

ds

Without start position With start position

Page 117: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Start offset tests...1,000,000 Columns

50 bytes per Column

Read first 100 Columns with start.Read middle 100 Columns with start.

Page 118: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and start offset...

0

10,000

20,000

30,000

40,000

85th 95th 99th

Late

cy M

icros

econ

ds

First MIddle

Page 119: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Start offset tests...1,000,000 Columns

50 bytes per Column

Read first 100 Columns without start.Read last 100 Columns with reversed.

Page 120: Apache Cassandra in Bangalore - Cassandra Internals and Performance

CF read latency and reversed...

0

10,000

20,000

30,000

40,000

85th 95th 99th

Late

cy M

icros

econ

ds

Forward Reversed

Page 121: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Thanks.

Page 122: Apache Cassandra in Bangalore - Cassandra Internals and Performance

Aaron Morton@aaronmorton

www.thelastpickle.com

Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License