summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-04-07 21:25:01 +0300
committerGitHub <noreply@github.com>2023-04-07 21:25:01 +0300
commit204dd9ae272445d13f308badb07e99675fa34892 (patch)
treef42e873c60219b5031dcfc3e076adb2398cdb3fe /daemon
parent61925baaf6e2448c641e8e71248a47f7a01c4efd (diff)
Boost dbengine (#14832)
* configure extent cache size * workers can now execute up to 10 jobs in a run, boosting query prep and extent reads * fix dispatched and executing counters * boost to the max * increase libuv worker threads * query prep always get more prio than extent reads; stop processing in batch when dbengine is queue is critical * fix accounting of query prep * inlining of time-grouping functions, to speed up queries with billions of points * make switching based on a local const variable * print one pending contexts loading message per iteration * inlined store engine query API * inlined storage engine data collection api * inlined all storage engine query ops * eliminate and inline data collection ops * simplified query group-by * more error handling * optimized partial trimming of group-by queries * preparative work to support multiple passes of group-by * more preparative work to support multiple passes of group-by (accepts multiple group-by params) * unified query timings * unified query timings - weights endpoint * query target is no longer a static thread variable - there is a list of cached query targets, each of which of freed every 1000 queries * fix query memory accounting * added summary.dimension[].pri and sorted summary.dimensions based on priority and then name * limit max ACLK WEB response size to 30MB * the response type should be text/plain * more preparative work for multiple group-by passes * create functions for generating group by keys, ids and names * multiple group-by passes are now supported * parse group-by options array also with an index * implemented percentage-of-instance group by function * family is now merged in multi-node contexts * prevent uninitialized use
Diffstat (limited to 'daemon')
-rw-r--r--daemon/main.c2
-rw-r--r--daemon/service.c2
-rw-r--r--daemon/unit_test.c16
3 files changed, 10 insertions, 10 deletions
diff --git a/daemon/main.c b/daemon/main.c
index 832a59b955..682106b78e 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -1834,7 +1834,7 @@ int main(int argc, char **argv) {
#endif
// set libuv worker threads
- libuv_worker_threads = (int)get_netdata_cpus() * 2;
+ libuv_worker_threads = (int)get_netdata_cpus() * 6;
if(libuv_worker_threads < MIN_LIBUV_WORKER_THREADS)
libuv_worker_threads = MIN_LIBUV_WORKER_THREADS;
diff --git a/daemon/service.c b/daemon/service.c
index 9761abd02d..57c7c7f398 100644
--- a/daemon/service.c
+++ b/daemon/service.c
@@ -55,7 +55,7 @@ static void svc_rrddim_obsolete_to_archive(RRDDIM *rd) {
if(rd->tiers[tier].db_collection_handle) {
tiers_available++;
- if(rd->tiers[tier].collect_ops->finalize(rd->tiers[tier].db_collection_handle))
+ if(storage_engine_store_finalize(rd->tiers[tier].db_collection_handle))
tiers_said_no_retention++;
rd->tiers[tier].db_collection_handle = NULL;
diff --git a/daemon/unit_test.c b/daemon/unit_test.c
index 4dd4b29931..fa3fa847f2 100644
--- a/daemon/unit_test.c
+++ b/daemon/unit_test.c
@@ -1937,7 +1937,7 @@ static time_t test_dbengine_create_metrics(RRDSET *st[CHARTS], RRDDIM *rd[CHARTS
// feed it with the test data
for (i = 0 ; i < CHARTS ; ++i) {
for (j = 0 ; j < DIMS ; ++j) {
- rd[i][j]->tiers[0].collect_ops->change_collection_frequency(rd[i][j]->tiers[0].db_collection_handle, update_every);
+ storage_engine_store_change_collection_frequency(rd[i][j]->tiers[0].db_collection_handle, update_every);
rd[i][j]->last_collected_time.tv_sec =
st[i]->last_collected_time.tv_sec = st[i]->last_updated.tv_sec = time_now;
@@ -1988,13 +1988,13 @@ static int test_dbengine_check_metrics(RRDSET *st[CHARTS], RRDDIM *rd[CHARTS][DI
time_now = time_start + (c + 1) * update_every;
for (i = 0 ; i < CHARTS ; ++i) {
for (j = 0; j < DIMS; ++j) {
- rd[i][j]->tiers[0].query_ops->init(rd[i][j]->tiers[0].db_metric_handle, &handle, time_now, time_now + QUERY_BATCH * update_every, STORAGE_PRIORITY_NORMAL);
+ storage_engine_query_init(rd[i][j]->tiers[0].backend, rd[i][j]->tiers[0].db_metric_handle, &handle, time_now, time_now + QUERY_BATCH * update_every, STORAGE_PRIORITY_NORMAL);
for (k = 0; k < QUERY_BATCH; ++k) {
last = ((collected_number)i * DIMS) * REGION_POINTS[current_region] +
j * REGION_POINTS[current_region] + c + k;
expected = unpack_storage_number(pack_storage_number((NETDATA_DOUBLE)last, SN_DEFAULT_FLAGS));
- STORAGE_POINT sp = rd[i][j]->tiers[0].query_ops->next_metric(&handle);
+ STORAGE_POINT sp = storage_engine_query_next_metric(&handle);
value = sp.sum;
time_retrieved = sp.start_time_s;
end_time = sp.end_time_s;
@@ -2016,7 +2016,7 @@ static int test_dbengine_check_metrics(RRDSET *st[CHARTS], RRDDIM *rd[CHARTS][DI
errors++;
}
}
- rd[i][j]->tiers[0].query_ops->finalize(&handle);
+ storage_engine_query_finalize(&handle);
}
}
}
@@ -2444,13 +2444,13 @@ static void query_dbengine_chart(void *arg)
time_before = MIN(time_after + duration, time_max); /* up to 1 hour queries */
}
- rd->tiers[0].query_ops->init(rd->tiers[0].db_metric_handle, &handle, time_after, time_before, STORAGE_PRIORITY_NORMAL);
+ storage_engine_query_init(rd->tiers[0].backend, rd->tiers[0].db_metric_handle, &handle, time_after, time_before, STORAGE_PRIORITY_NORMAL);
++thread_info->queries_nr;
for (time_now = time_after ; time_now <= time_before ; time_now += update_every) {
generatedv = generate_dbengine_chart_value(i, j, time_now);
expected = unpack_storage_number(pack_storage_number((NETDATA_DOUBLE) generatedv, SN_DEFAULT_FLAGS));
- if (unlikely(rd->tiers[0].query_ops->is_finished(&handle))) {
+ if (unlikely(storage_engine_query_is_finished(&handle))) {
if (!thread_info->delete_old_data) { /* data validation only when we don't delete */
fprintf(stderr, " DB-engine stresstest %s/%s: at %lu secs, expecting value " NETDATA_DOUBLE_FORMAT
", found data gap, ### E R R O R ###\n",
@@ -2460,7 +2460,7 @@ static void query_dbengine_chart(void *arg)
break;
}
- STORAGE_POINT sp = rd->tiers[0].query_ops->next_metric(&handle);
+ STORAGE_POINT sp = storage_engine_query_next_metric(&handle);
value = sp.sum;
time_retrieved = sp.start_time_s;
end_time = sp.end_time_s;
@@ -2498,7 +2498,7 @@ static void query_dbengine_chart(void *arg)
}
}
}
- rd->tiers[0].query_ops->finalize(&handle);
+ storage_engine_query_finalize(&handle);
} while(!thread_info->done);
if(value_errors)