Skip to content

Commit 041dd18

Browse files
committed
perf(v2only): use constraint workload in rolling transfer
1 parent 386c624 commit 041dd18

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

backend/pkg/commons/db/clickhouse.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func MustInitClickhouseNative(writer *types.DatabaseConfig) ch.Conn {
6767
// trade of higher background overhead for lower query specific memory pressure
6868
// reduces memory usage by 20-30% in our prod insert queries
6969
"optimize_on_insert": "0",
70+
"compatibility": "25.6", // enables spill to disk when memory usage is too high, among other things
7071
},
7172
ClientInfo: ch.ClientInfo{
7273
Products: []struct {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- +goose Up
2+
-- +goose StatementBegin
3+
CREATE RESOURCE IF NOT EXISTS query (query);
4+
-- +goose StatementEnd
5+
-- +goose StatementBegin
6+
CREATE WORKLOAD IF NOT EXISTS exporter_rollings SETTINGS max_concurrent_queries = 1;
7+
-- +goose StatementEnd
8+
9+
-- +goose Down
10+
-- +goose StatementBegin
11+
DROP WORKLOAD IF EXISTS exporter_rollings;
12+
-- +goose StatementEnd
13+
-- +goose StatementBegin
14+
DROP RESOURCE IF EXISTS query;
15+
-- +goose StatementEnd

backend/pkg/exporter/db/db.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ func TransferRollingSourceToRolling(rolling Rollings, source RollingSourcesSuffi
16641664
"select_sequential_consistency": 1,
16651665
"use_skip_indexes_if_final": 1, // this is only safe because our index is over a column from the primary key
16661666
"max_threads": 2,
1667+
"workload": "exporter_rollings", // configured to 2 concurrent queries per node at the time of writing
16671668
}))
16681669
column := "t"
16691670
selector := `

backend/pkg/exporter/modules/dashboard_data_rollings.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ func (d *dashboardData) handleRollings() error {
3636
edb.Rolling90d,
3737
edb.RollingTotal,
3838
}
39-
// but lets limit to x rollings
4039
eg := errgroup.Group{}
41-
eg.SetLimit(int(utils.Config.DashboardExporter.RollingsInParallel))
40+
//eg.SetLimit(int(utils.Config.DashboardExporter.RollingsInParallel))
4241
for _, rolling := range rollings {
4342
rolling := rolling
4443
eg.Go(func() error {

0 commit comments

Comments
 (0)