[英]How to use correctly cassandra-stress tool in user profile mode?
我正在嘗試使用cassandra-stress測試我的3個Cassandra(3.11.3.5)群集節點。 目前,我正在運行3個節點和1台運行cassandra-tool的計算機,一切都在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
我改變了什么:
而且我總是會遇到一些錯誤,例如:
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 cfhistograms mykeyspace mytable
時得到的延遲時間完全不同? 在節點上,我得到大約200毫秒的等待時間,即99%的寫入延遲。 可能與cassandra-tool用於將MB數據發送到協調器所花費的時間有關嗎?
為什么在cassandra-tool命令中更改油門/固定速率開關沒有看到任何效果? 我總是得到1 op / s
如果我有一個生產集群(如測試集群),即使我收到的混合工作負載量大得多(在3個小時內讀取60萬次寫入和100萬次寫入),卻沒有這些錯誤,為什么我會如此頻繁地收到以前的錯誤?
我知道這是一個舊線程,但是:
我也在配置Cassandra集群,並且在此過程中有些頭疼。
為了生成我的個人資料,我使用了此參考 。
關於異常,如果我是對的,您會發現cassandra-stress工具無法連接到集群中的任何節點。
看一看的東西:
start_native_transport
設置為true? listen_address
或listen_interface
配置設置為所需的IP地址? 默認值為127.0.0.1 這些是我必須更改的一些功能,以便能夠遠程連接。 希望對您有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.