1

を使用してCassandra database in production environmentいます。single cross colo cluster of 24 nodes意味が12 nodes in PHXあり12 nodes in SLC coloます。というreplication factor of 4意味があり2 copies will be there in each datacenterます。

以下は、keyspacecolumn familiesが作成された方法Production DBA'sです。

placement_strategy = 'org.apache.cassandra.locator.NetworkTopologyStrategy' および strategy_options = {slc:2,phx:2} でキースペース プロファイルを作成します。

create column family PROFILE_USER
with key_validation_class = 'UTF8Type'
and comparator = 'UTF8Type'
and default_validation_class = 'UTF8Type'
and gc_grace = 86400;

私たちは実行Cassandra 1.2.2しておりorg.apache.cassandra.dht.Murmur3Partitioner、 、 with KeyCachingSizeTieredCompactionStrategyおよびVirtual Nodesenabled も持っています。Cassandra ノードはHDD instead ofSSD にデプロイされます。

を使用Astyanax clientしてデータを読み取るためにCassandra database使用していconsistency level as ONEます。50 Millions recordsを使用して実稼働クラスターに (24 ノードで合計約 285GB のデータ)を挿入Astyanax clientし、圧縮が完了した後、実行を開始しread against the Cassandra production databaseました。

以下は、次を使用して接続構成を作成するコードですAstyanax client-

/**
 * Creating Cassandra connection using Astyanax client
 *
 */
private CassandraAstyanaxConnection() {

    context = new AstyanaxContext.Builder()
    .forCluster(ModelConstants.CLUSTER)
    .forKeyspace(ModelConstants.KEYSPACE)
    .withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
        .setPort(9160)
        .setMaxConnsPerHost(100)
        .setSeeds("cdb03.vip.phx.host.com:9160,cdb04.vip.phx.host.com:9160")
        .setLocalDatacenter("phx") //filtering out the nodes basis on data center
    )
    .withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
        .setCqlVersion("3.0.0")
        .setTargetCassandraVersion("1.2")
        .setConnectionPoolType(ConnectionPoolType.ROUND_ROBIN)
        .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE))
    .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
    .buildKeyspace(ThriftFamilyFactory.getInstance());

    context.start();
    keyspace = context.getEntity();

    emp_cf = ColumnFamily.newColumnFamily(
        ModelConstants.COLUMN_FAMILY, 
        StringSerializer.get(), 
        StringSerializer.get());
}

ほとんどの場合、私は95th percentile read performance動き回ってい8/9/10 msます。

私は、私がより良くなる方法があるかどうかを見ようとしていread performanceますCassandra database. 私は 95 パーセンタイルを取得するという印象を受けました1 or 2 msが、実稼働クラスターでいくつかのテストを行った後、私の仮説はすべて間違っていました。クライアント プログラムを実行している場所から Cassandra 本番ノードへの ping 時間は です0.3ms average

以下は私が得ている結果です。

Read Latency(95th Percentile)      Number of Threads    Duration the program was running(in minutes)    Throughput(requests/seconds)    Total number of id's requested    Total number of columns requested
    8 milliseconds                         10                      30                                               1584                              2851481                        52764072

優れた読み取りレイテンシーパフォーマンスを達成するために他に試してみることができることについて、誰かが光を当てることができますか? 私と同じ状況で、Cassandra を本番環境で使用している同様の人がいる可能性があることはわかっています。どんな助けでも大歓迎です。

助けてくれてありがとう。

4

1 に答える 1