Testing 如何在用户配置文件模式下正确使用cassandra压力工具?

Testing 如何在用户配置文件模式下正确使用cassandra压力工具?,testing,cassandra,cassandra-3.0,Testing,Cassandra,Cassandra 3.0,我正在尝试使用Cassandra压力测试我的3个Cassandra(3.11.3.5)集群节点。 目前我正在运行3个节点和1台机器,其中cassandra工具正在运行,所有东西都在openvpn网络上 我已在此处创建了我的.yaml用户配置文件测试文件: ### DML ### # Keyspace Name keyspace: mykeyspace # The CQL for creating a keyspace (optional if it already exists) keysp

我正在尝试使用Cassandra压力测试我的3个Cassandra(3.11.3.5)集群节点。 目前我正在运行3个节点和1台机器,其中cassandra工具正在运行,所有东西都在openvpn网络上

我已在此处创建了我的.yaml用户配置文件测试文件:

### DML ###

# Keyspace Name
keyspace: mykeyspace

# The CQL for creating a keyspace (optional if it already exists)
keyspace_definition: |
  CREATE KEYSPACE mykeyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': '2'}  AND durable_writes = false;

# Table name
table: mytable

# The CQL for creating a table you wish to stress (optional if it already exists)
table_definition: |
  CREATE TABLE mytable (
    id bigint, 
    type int,
    txt text,
    event_datetime timestamp,
    bigtxt text,    
    page int,
    PRIMARY KEY ((id, type), page, event_datetime)
  ) WITH CLUSTERING ORDER BY (page DESC, event_datetime DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = 'ciao'
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 90000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

### Column Distribution Specifications ###

columnspec:
  - name: id
    size: gaussian(1..1000)       
    population: gaussian(1..500k)  

  - name: type
    size: gaussian(0..5)
    population: gaussian(1..5)

  - name: event_datetime
    cluster: fixed(1)         

  - name: page                  
    size: ~exp(1..20)
    population: ~exp(1..20)
    cluster: fixed(1)

  - name: txt
    size: exp(30..1k)

  - name: bigtxt
    size: gaussian(10k..30M)    


### Batch Ratio Distribution Specifications ###

insert:
  partitions: fixed(1)            # Our partition key is the domain so only insert one per batch

  select:    fixed(1)/1        

  batchtype: UNLOGGED             # Unlogged batches

queries:
   pages:
      cql: select id, page, type, txt, event_datetime, bigtxt from mytable where id = ? and type = ? and page=? limit 10;
      fields: multirow
到目前为止,我运行的命令是对此命令的修改:

cassandra-stress user n=30 profile=./myprofile.yml ops\(insert=1\) -rate threads=10 -node 10.5.0.1,10.5.0.6,10.5.0.8
我改变了什么:

  • n
  • 线程数
  • 旧油门
  • 固定使用
我总是会犯一些错误,比如:

com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: 10.5.0.1/10.5.0.1:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [10.5.0.1/10.5.0.1] Timed out waiting for server response), 10.5.0.6/10.5.0.6:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [10.5.0.6/10.5.0.6] Timed out waiting for server response), 10.5.0.8/10.5.0.8:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [10.5.0.8/10.5.0.8] Timed out waiting for server response))
我在变暖阶段也发现了这些错误

运行结果如下所示:

Results:
Op rate                   :        0 op/s  [insert: 1 op/s]
Partition rate            :        0 pk/s  [insert: 1 pk/s]
Row rate                  :        2 row/s [insert: 3 row/s]
Latency mean              : 38172.3 ms [insert: 38,172.3 ms]
Latency median            : 37279.0 ms [insert: 37,279.0 ms]
Latency 95th percentile   : 59190.0 ms [insert: 59,190.0 ms]
Latency 99th percentile   : 59458.5 ms [insert: 59,458.5 ms]
Latency 99.9th percentile : 59458.5 ms [insert: 59,458.5 ms]
Latency max               : 59458.5 ms [insert: 59,458.5 ms]
Total partitions          :         30 [insert: 30]
Total errors              :          0 [insert: 0]
Total GC count            : 2
Total GC memory           : 3.396 GiB
Total GC time             :    0.2 seconds
Avg GC time               :  117.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:01:04
我不能理解的是:

  • 为什么延迟时间与我在节点上运行
    nodetool cf直方图mykeyspace mytable
    时得到的时间完全不同?在节点上,我得到了大约200毫秒的延迟,99%的写入时间。可能与cassandra工具向协调器发送MBs数据所花费的时间有关

  • 为什么在cassandra工具命令中更改油门/固定速率开关时看不到任何效果?我总是得到1个op/s

  • 如果我有一个生产集群,比如测试集群,即使它接收到更重的混合工作负载(大约3小时内读取600k次,写入1M次),但却没有这些错误,为什么我会如此频繁地收到以前的错误


  • 我知道这是一条旧线,但是:

    我也在配置Cassandra集群,在这个过程中遇到了一些麻烦

    为了生成我的个人资料,我使用了

    关于您得到的异常,如果我是对的,cassandra压力工具无法连接到集群中的任何节点

    有些东西需要看一下:

    • 在cassandra.yaml文件中,您是否将配置
      start\u native\u transport
      设置为true
    • 仍在cassandra.yaml文件中,您是否已将
      listen\u地址
      listen\u接口
      配置设置为所需的IP地址?默认值为127.0.0.1
    • 您是否有防火墙配置阻止访问端口9042
    这些都是我必须改变才能远程连接的一些事情。
    我希望这能有所帮助

    我知道这是一条旧线索,但是:

    我也在配置Cassandra集群,在这个过程中遇到了一些麻烦

    为了生成我的个人资料,我使用了

    关于您得到的异常,如果我是对的,cassandra压力工具无法连接到集群中的任何节点

    有些东西需要看一下:

    • 在cassandra.yaml文件中,您是否将配置
      start\u native\u transport
      设置为true
    • 仍在cassandra.yaml文件中,您是否已将
      listen\u地址
      listen\u接口
      配置设置为所需的IP地址?默认值为127.0.0.1
    • 您是否有防火墙配置阻止访问端口9042
    这些都是我必须改变才能远程连接的一些事情。 我希望这能有所帮助