Comments (9)
The flushInterval
config must not be zero, it holds a time ticker to flush the message into ClickHouse, maybe you could find the errorr msgs like:
panic: non-positive interval for NewTicker
from clickhouse_sinker.
I've tried to set flushInterval
2 for e.g., the same.
from clickhouse_sinker.
Is that any logs?
Maybe it will be better to paste all the configs.
from clickhouse_sinker.
2020/01/09 12:30:05 Initial [clickhouse_sinker]
&creator.Config{
Kafka: {
"kafka1": &creator.KafkaConfig{
Brokers: "kafka-broker1-int.test.com:9091",
Sasl: struct { Password string; Username string }{
Password: "",
Username: "",
},
Version: "2.0.1",
},
"kafka2": &creator.KafkaConfig{
Brokers: "kafka-broker2-int.test.com:9091",
Sasl: struct { Password string; Username string }{
Password: "",
Username: "",
},
Version: "2.0.1",
},
"kafka3": &creator.KafkaConfig{
Brokers: "kafka-broker3-int.test.com:9091",
Sasl: struct { Password string; Username string }{
Password: "",
Username: "",
},
Version: "2.0.1",
},
},
Clickhouse: {
"clickhouse-r1-s1": &creator.ClickHouseConfig{
Db: "test",
Host: "r1s1-clickhouse-int.test.com",
Port: 9000,
Username: "test",
Password: "password",
MaxLifeTime: 300,
RetryTimes: 5,
},
"clickhouse-r1-s2": &creator.ClickHouseConfig{
Db: "test",
Host: "r1s2-clickhouse-int.test.com",
Port: 9000,
Username: "test",
Password: "password",
MaxLifeTime: 300,
RetryTimes: 5,
},
"clickhouse-r1-s3": &creator.ClickHouseConfig{
Db: "test",
Host: "r1s3-clickhouse-int.test.com",
Port: 9000,
Username: "test",
Password: "password",
MaxLifeTime: 300,
RetryTimes: 5,
},
"clickhouse-r1-s4": &creator.ClickHouseConfig{
Db: "test",
Host: "r1s4-clickhouse-int.test.com",
Port: 9000,
Username: "test",
Password: "password",
MaxLifeTime: 300,
RetryTimes: 5,
},
"clickhouse-r1-s5": &creator.ClickHouseConfig{
Db: "test",
Host: "r1s5-clickhouse-int.test.com",
Port: 9000,
Username: "test",
Password: "password",
MaxLifeTime: 300,
RetryTimes: 5,
},
"clickhouse-r1-s6": &creator.ClickHouseConfig{
Db: "test",
Host: "r1s6-clickhouse-int.test.com",
Port: 9000,
Username: "test",
Password: "password",
MaxLifeTime: 300,
RetryTimes: 5,
},
},
Tasks: []*creator.Task{
&creator.Task{
Name: "test_requests_ch",
Kafka: "kafka1",
Topic: "test_requests_ch",
ConsumerGroup: "test_test_requests_ch_qe",
Earliest: true,
Parser: "json",
CsvFormat: []string{},
Delimiter: "",
Clickhouse: "clickhouse-r1-s1",
TableName: "test_test_requests",
AutoSchema: true,
ExcludeColumns: []string{},
Dims: []struct { Name string; Type string }{},
Metrics: []struct { Name string; Type string }{},
FlushInterval: 0,
BufferSize: 0,
MinBufferSize: 0,
},
},
Common: struct { FlushInterval int; BufferSize int; MinBufferSize int; LogLevel string }{
FlushInterval: 2,
BufferSize: 9000000,
MinBufferSize: 2000,
LogLevel: "info",
},
}
2020/01/09 12:30:05 Initial [clickhouse_sinker] complete
2020/01/09 12:30:05 [I] Prepare sql=> INSERT INTO test.test_test_requests (date,ad_type,app_id,platform_id,campaign_id,campaign_image_id,campaign_type,country_id,user_id,manager_id,user_only,segment_id,placement_id,account_id,request_count) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
2020/01/09 12:30:05 [I] start to dial kafka kafka-broker1-int.test.com:9091
2020/01/09 12:30:05 [I] TaskService test_requests_ch TaskService has started
2020/01/09 12:30:07 [I] test_requests_ch tick
2020/01/09 12:30:07 [I] buf size: 465448
2020/01/09 12:30:13 [I] test_requests_ch tick
2020/01/09 12:30:13 [I] test_requests_ch tick
2020/01/09 12:30:13 [I] buf size: 296500
2020/01/09 12:30:16 [I] test_requests_ch tick
2020/01/09 12:30:17 [I] test_requests_ch tick
2020/01/09 12:30:17 [I] buf size: 556270
2020/01/09 12:30:23 [I] test_requests_ch tick
....
kafka1, kafka2, kafka3 - cluster with RF 3.
INSERT INTO test.test_test_requests ...
- test.test_test_requests is distributed table.
from clickhouse_sinker.
The logs show it works well, it shows single sinker could achieve TPS about 50k/s, do you mean that the speed is too slow?
There are some tips to improve it
- Multi-node clickhouse_sinker, better as the same number as the kafka topic partition.
- Parsing the messages on parallel,now we just parse it with single goroutine, it's ok for most cases, and it depends on your data size.
Later we will add some metrics to show which step is the bottleneck, parsing or flushing to ck.
from clickhouse_sinker.
Thank you for tips. I've configured as you recommended. Need few days for monitoring this.
from clickhouse_sinker.
As you've recommended it works quite well!
Thank You!
from clickhouse_sinker.
@sundy-li Hi May I know how to set multi-node sinker for the same topic ? thx
from clickhouse_sinker.
@FinnWang2077 clickhouse_sinker 2.0+ config file format differ with 1.x. Please use latest release.
You can let multiple sinker use the same config file so that they consume a Kafka topic with the same consume group.
from clickhouse_sinker.
Related Issues (20)
- use clickhouse-go v2 HOT 3
- Use franz-go to calculate lags
- Find replacement for https://github.com/pkg/errors
- How can I new multi task in on clickhouse_sinker HOT 2
- investigate bitmap 64 https://github.com/outcaste-io/sroar HOT 1
- 【Help】clickhouse_sinker auto stop when I config tasks, It run well when config single task. HOT 1
- bug nacos服务注册 无法正常消费 HOT 8
- 没有平衡的写入数据 HOT 2
- 一个sinker程序,只能拥有一个task吗? HOT 1
- 启动失败,说无此类登入,很好奇,出现的表也不是任务中的表 HOT 2
- Evaluate sonic parser
- [bug]分布式表配置检查错误 HOT 1
- Contact from ClickHouse HOT 2
- partition xx quit idle or partition xx became idle HOT 1
- 日志按时间滚动? HOT 2
- 使用sarama客户端鉴权问题 HOT 1
- clickhouse_sinker_parsing_pool_backlog 如何配置? HOT 3
- [help] 每次处理的message 批次大小不一? HOT 1
- 依赖版本找不到 HOT 1
- Build image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse_sinker.