@cryptotaxi247 / netdata-1 / commits / fbdb5ff55

Increase number of pages per extent in dbengine (#17343)

Increase max extent pages to 109 Default to be used is still 64

Stelios Fragkakis committed Apr 8, 2024 at 22:33 UTC fbdb5ff55ed06a1717b484cbdb2fedbf7b7f5c79
3 files changed +5 -4
src/database/engine/rrdengine.c
+1 -1
@@ -11,7 +11,7 @@ rrdeng_stats_t rrdeng_reserved_file_descriptors = 0;
11 rrdeng_stats_t global_pg_cache_over_half_dirty_events = 0;
12 rrdeng_stats_t global_flushing_pressure_page_deletions = 0;
13
14 -unsigned rrdeng_pages_per_extent = MAX_PAGES_PER_EXTENT;
14 +unsigned rrdeng_pages_per_extent = DEFAULT_PAGES_PER_EXTENT;
15
16 #if WORKER_UTILIZATION_MAX_JOB_TYPES < (RRDENG_OPCODE_MAX + 2)
17 #error Please increase WORKER_UTILIZATION_MAX_JOB_TYPES to at least (RRDENG_MAX_OPCODE + 2)
src/database/engine/rrdengine.h
+2 -1
@@ -30,7 +30,8 @@ extern unsigned rrdeng_pages_per_extent;
30 struct rrdengine_instance;
31 struct rrdeng_cmd;
32
33 -#define MAX_PAGES_PER_EXTENT (64) /* TODO: can go higher only when journal supports bigger than 4KiB transactions */
33 +#define MAX_PAGES_PER_EXTENT (109) /* TODO: can go higher only when journal supports bigger than 4KiB transactions */
34 +#define DEFAULT_PAGES_PER_EXTENT (64)
35
36 #define RRDENG_FILE_NUMBER_SCAN_TMPL "%1u-%10u"
37 #define RRDENG_FILE_NUMBER_PRINT_TMPL "%1.1u-%10.10u"
src/database/rrdhost.c
+2 -2
@@ -827,8 +827,8 @@ void dbengine_init(char *hostname) {
827 #ifdef ENABLE_DBENGINE
828 use_direct_io = config_get_boolean(CONFIG_SECTION_DB, "dbengine use direct io", use_direct_io);
829
830 - unsigned read_num = (unsigned)config_get_number(CONFIG_SECTION_DB, "dbengine pages per extent", MAX_PAGES_PER_EXTENT);
831 - if (read_num > 0 && read_num <= MAX_PAGES_PER_EXTENT)
830 + unsigned read_num = (unsigned)config_get_number(CONFIG_SECTION_DB, "dbengine pages per extent", DEFAULT_PAGES_PER_EXTENT);
831 + if (read_num > 0 && read_num <= DEFAULT_PAGES_PER_EXTENT)
832 rrdeng_pages_per_extent = read_num;
833 else {
834 nd_log(NDLS_DAEMON, NDLP_WARNING,