diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/buildinfo.c | 20 | ||||
-rw-r--r-- | daemon/commands.c | 16 | ||||
-rw-r--r-- | daemon/commands.h | 1 | ||||
-rw-r--r-- | daemon/config/README.md | 4 | ||||
-rw-r--r-- | daemon/main.c | 6 | ||||
-rw-r--r-- | daemon/service.c | 45 | ||||
-rw-r--r-- | daemon/signals.c | 9 | ||||
-rw-r--r-- | daemon/unit_test.c | 2 |
8 files changed, 4 insertions, 99 deletions
diff --git a/daemon/buildinfo.c b/daemon/buildinfo.c index d7603393f4..a84620f53c 100644 --- a/daemon/buildinfo.c +++ b/daemon/buildinfo.c @@ -57,8 +57,6 @@ typedef enum __attribute__((packed)) { BIB_DB_DBENGINE, BIB_DB_ALLOC, BIB_DB_RAM, - BIB_DB_MAP, - BIB_DB_SAVE, BIB_DB_NONE, BIB_CONNECTIVITY_ACLK, BIB_CONNECTIVITY_HTTPD_STATIC, @@ -554,22 +552,6 @@ static struct { .json = "ram", .value = NULL, }, - [BIB_DB_MAP] = { - .category = BIC_DATABASE, - .type = BIT_BOOLEAN, - .analytics = NULL, - .print = "map", - .json = "map", - .value = NULL, - }, - [BIB_DB_SAVE] = { - .category = BIC_DATABASE, - .type = BIT_BOOLEAN, - .analytics = NULL, - .print = "save", - .json = "save", - .value = NULL, - }, [BIB_DB_NONE] = { .category = BIC_DATABASE, .type = BIT_BOOLEAN, @@ -1101,8 +1083,6 @@ __attribute__((constructor)) void initialize_build_info(void) { #endif build_info_set_status(BIB_DB_ALLOC, true); build_info_set_status(BIB_DB_RAM, true); - build_info_set_status(BIB_DB_MAP, true); - build_info_set_status(BIB_DB_SAVE, true); build_info_set_status(BIB_DB_NONE, true); build_info_set_status(BIB_CONNECTIVITY_HTTPD_STATIC, true); diff --git a/daemon/commands.c b/daemon/commands.c index 75cccf7c4f..9cfc581c60 100644 --- a/daemon/commands.c +++ b/daemon/commands.c @@ -36,7 +36,6 @@ struct command_context { /* Forward declarations */ static cmd_status_t cmd_help_execute(char *args, char **message); static cmd_status_t cmd_reload_health_execute(char *args, char **message); -static cmd_status_t cmd_save_database_execute(char *args, char **message); static cmd_status_t cmd_reopen_logs_execute(char *args, char **message); static cmd_status_t cmd_exit_execute(char *args, char **message); static cmd_status_t cmd_fatal_execute(char *args, char **message); @@ -52,7 +51,6 @@ static cmd_status_t cmd_dumpconfig(char *args, char **message); static command_info_t command_info_array[] = { {"help", cmd_help_execute, CMD_TYPE_HIGH_PRIORITY}, // show help menu {"reload-health", cmd_reload_health_execute, CMD_TYPE_ORTHOGONAL}, // reload health configuration - {"save-database", cmd_save_database_execute, CMD_TYPE_ORTHOGONAL}, // save database for memory mode save {"reopen-logs", cmd_reopen_logs_execute, CMD_TYPE_ORTHOGONAL}, // Close and reopen log files {"shutdown-agent", cmd_exit_execute, CMD_TYPE_EXCLUSIVE}, // exit cleanly {"fatal-agent", cmd_fatal_execute, CMD_TYPE_HIGH_PRIORITY}, // exit with fatal error @@ -150,20 +148,6 @@ static cmd_status_t cmd_reload_health_execute(char *args, char **message) return CMD_STATUS_SUCCESS; } -static cmd_status_t cmd_save_database_execute(char *args, char **message) -{ - (void)args; - (void)message; - - nd_log_limits_unlimited(); - netdata_log_info("COMMAND: Saving databases."); - rrdhost_save_all(); - netdata_log_info("COMMAND: Databases saved."); - nd_log_limits_reset(); - - return CMD_STATUS_SUCCESS; -} - static cmd_status_t cmd_reopen_logs_execute(char *args, char **message) { (void)args; diff --git a/daemon/commands.h b/daemon/commands.h index 368a70a0f4..45a76110ca 100644 --- a/daemon/commands.h +++ b/daemon/commands.h @@ -9,7 +9,6 @@ typedef enum cmd { CMD_HELP = 0, CMD_RELOAD_HEALTH, - CMD_SAVE_DATABASE, CMD_REOPEN_LOGS, CMD_EXIT, CMD_FATAL, diff --git a/daemon/config/README.md b/daemon/config/README.md index 11ba2a1bc7..0642330f47 100644 --- a/daemon/config/README.md +++ b/daemon/config/README.md @@ -88,8 +88,8 @@ Please note that your data history will be lost if you have modified `history` p | setting | default | info | |:---------------------------------------------:|:----------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| mode | `dbengine` | `dbengine`: The default for long-term metrics storage with efficient RAM and disk usage. Can be extended with `dbengine page cache size MB` and `dbengine disk space MB`. <br />`save`: Netdata will save its round robin database on exit and load it on startup. <br />`map`: Cache files will be updated in real-time. Not ideal for systems with high load or slow disks (check `man mmap`). <br />`ram`: The round-robin database will be temporary and it will be lost when Netdata exits. <br />`alloc`: Similar to `ram`, but can significantly reduce memory usage, when combined with a low retention and does not support KSM. <br />`none`: Disables the database at this host, and disables health monitoring entirely, as that requires a database of metrics. Not to be used together with streaming. | -| retention | `3600` | Used with `mode = save/map/ram/alloc`, not the default `mode = dbengine`. This number reflects the number of entries the `netdata` daemon will by default keep in memory for each chart dimension. Check [Memory Requirements](https://github.com/netdata/netdata/blob/master/database/README.md) for more information. | +| mode | `dbengine` | `dbengine`: The default for long-term metrics storage with efficient RAM and disk usage. Can be extended with `dbengine page cache size MB` and `dbengine disk space MB`. <br />`ram`: The round-robin database will be temporary and it will be lost when Netdata exits. <br />`alloc`: Similar to `ram`, but can significantly reduce memory usage, when combined with a low retention and does not support KSM. <br />`none`: Disables the database at this host, and disables health monitoring entirely, as that requires a database of metrics. Not to be used together with streaming. | +| retention | `3600` | Used with `mode = ram/alloc`, not the default `mode = dbengine`. This number reflects the number of entries the `netdata` daemon will by default keep in memory for each chart dimension. Check [Memory Requirements](https://github.com/netdata/netdata/blob/master/database/README.md) for more information. | | storage tiers | `1` | The number of storage tiers you want to have in your dbengine. Check the tiering mechanism in the [dbengine's reference](https://github.com/netdata/netdata/blob/master/database/engine/README.md#tiering). You can have up to 5 tiers of data (including the _Tier 0_). This number ranges between 1 and 5. | | dbengine page cache size MB | `32` | Determines the amount of RAM in MiB that is dedicated to caching for _Tier 0_ Netdata metric values. | | dbengine tier **`N`** page cache size MB | `32` | Determines the amount of RAM in MiB that is dedicated for caching Netdata metric values of the **`N`** tier. <br /> `N belongs to [1..4]` | diff --git a/daemon/main.c b/daemon/main.c index 3a9e009491..a88fef5e1f 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -404,10 +404,6 @@ void netdata_cleanup_and_exit(int ret, const char *action, const char *action_re web_client_cache_destroy(); - delta_shutdown_time("clean rrdhost database"); - - rrdhost_cleanup_all(); - delta_shutdown_time("stop aclk threads"); timeout = !service_wait_exit( @@ -1229,7 +1225,7 @@ static void get_netdata_configured_variables() { #else if (default_rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE) { error_report("RRD_MEMORY_MODE_DBENGINE is not supported in this platform. The agent will use db mode 'save' instead."); - default_rrd_memory_mode = RRD_MEMORY_MODE_SAVE; + default_rrd_memory_mode = RRD_MEMORY_MODE_RAM; } #endif diff --git a/daemon/service.c b/daemon/service.c index 3f47a8fa27..e87d8ed40b 100644 --- a/daemon/service.c +++ b/daemon/service.c @@ -16,11 +16,7 @@ #define WORKER_JOB_CLEANUP_ORPHAN_HOSTS 6 #define WORKER_JOB_CLEANUP_OBSOLETE_CHARTS_ON_HOSTS 7 #define WORKER_JOB_FREE_HOST 9 -#define WORKER_JOB_SAVE_HOST_CHARTS 10 -#define WORKER_JOB_DELETE_HOST_CHARTS 11 #define WORKER_JOB_FREE_CHART 12 -#define WORKER_JOB_SAVE_CHART 13 -#define WORKER_JOB_DELETE_CHART 14 #define WORKER_JOB_FREE_DIMENSION 15 #define WORKER_JOB_PGC_MAIN_EVICT 16 #define WORKER_JOB_PGC_MAIN_FLUSH 17 @@ -38,13 +34,6 @@ static void svc_rrddim_obsolete_to_archive(RRDDIM *rd) { rrddim_flag_set(rd, RRDDIM_FLAG_ARCHIVED); rrddim_flag_clear(rd, RRDDIM_FLAG_OBSOLETE); - const char *cache_filename = rrddim_cache_filename(rd); - if(cache_filename) { - netdata_log_info("Deleting dimension file '%s'.", cache_filename); - if (unlikely(unlink(cache_filename) == -1)) - netdata_log_error("Cannot delete dimension file '%s'", cache_filename); - } - if (rd->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE) { rrddimvar_delete_all(rd); @@ -133,17 +122,6 @@ static void svc_rrdset_obsolete_to_free(RRDSET *st) { // has to be run after all dimensions are archived - or use-after-free will occur rrdvar_delete_all(st->rrdvars); - if(st->rrd_memory_mode != RRD_MEMORY_MODE_DBENGINE) { - if(rrdhost_option_check(st->rrdhost, RRDHOST_OPTION_DELETE_OBSOLETE_CHARTS)) { - worker_is_busy(WORKER_JOB_DELETE_CHART); - rrdset_delete_files(st); - } - else { - worker_is_busy(WORKER_JOB_SAVE_CHART); - rrdset_save(st); - } - } - rrdset_free(st); } @@ -269,28 +247,11 @@ restart_after_removal: if(!rrdhost_should_be_removed(host, protected_host, now)) continue; - bool is_archived = rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED); - if (!is_archived) { - netdata_log_info("Host '%s' with machine guid '%s' is obsolete - cleaning up.", rrdhost_hostname(host), host->machine_guid); - - if (rrdhost_option_check(host, RRDHOST_OPTION_DELETE_ORPHAN_HOST) - /* don't delete multi-host DB host files */ - && !(host->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE && is_storage_engine_shared(host->db[0].si)) - ) { - worker_is_busy(WORKER_JOB_DELETE_HOST_CHARTS); - rrdhost_delete_charts(host); - } - else { - worker_is_busy(WORKER_JOB_SAVE_HOST_CHARTS); - rrdhost_save_charts(host); - } - } - bool force = false; - if (rrdhost_option_check(host, RRDHOST_OPTION_EPHEMERAL_HOST) && now - host->last_connected > rrdhost_free_ephemeral_time_s) force = true; + bool is_archived = rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED); if (!force && is_archived) continue; @@ -339,11 +300,7 @@ void *service_main(void *ptr) worker_register_job_name(WORKER_JOB_CLEANUP_ORPHAN_HOSTS, "cleanup orphan hosts"); worker_register_job_name(WORKER_JOB_CLEANUP_OBSOLETE_CHARTS_ON_HOSTS, "cleanup obsolete charts on all hosts"); worker_register_job_name(WORKER_JOB_FREE_HOST, "free host"); - worker_register_job_name(WORKER_JOB_SAVE_HOST_CHARTS, "save host charts"); - worker_register_job_name(WORKER_JOB_DELETE_HOST_CHARTS, "delete host charts"); worker_register_job_name(WORKER_JOB_FREE_CHART, "free chart"); - worker_register_job_name(WORKER_JOB_SAVE_CHART, "save chart"); - worker_register_job_name(WORKER_JOB_DELETE_CHART, "delete chart"); worker_register_job_name(WORKER_JOB_FREE_DIMENSION, "free dimension"); worker_register_job_name(WORKER_JOB_PGC_MAIN_EVICT, "main cache evictions"); worker_register_job_name(WORKER_JOB_PGC_MAIN_FLUSH, "main cache flushes"); diff --git a/daemon/signals.c b/daemon/signals.c index dcc09b892a..c014452b7d 100644 --- a/daemon/signals.c +++ b/daemon/signals.c @@ -6,7 +6,6 @@ typedef enum signal_action { NETDATA_SIGNAL_END_OF_LIST, NETDATA_SIGNAL_IGNORE, NETDATA_SIGNAL_EXIT_CLEANLY, - NETDATA_SIGNAL_SAVE_DATABASE, NETDATA_SIGNAL_REOPEN_LOGS, NETDATA_SIGNAL_RELOAD_HEALTH, NETDATA_SIGNAL_FATAL, @@ -24,7 +23,6 @@ static struct { { SIGQUIT, "SIGQUIT", 0, NETDATA_SIGNAL_EXIT_CLEANLY }, { SIGTERM, "SIGTERM", 0, NETDATA_SIGNAL_EXIT_CLEANLY }, { SIGHUP, "SIGHUP", 0, NETDATA_SIGNAL_REOPEN_LOGS }, - { SIGUSR1, "SIGUSR1", 0, NETDATA_SIGNAL_SAVE_DATABASE }, { SIGUSR2, "SIGUSR2", 0, NETDATA_SIGNAL_RELOAD_HEALTH }, { SIGBUS, "SIGBUS", 0, NETDATA_SIGNAL_FATAL }, { SIGCHLD, "SIGCHLD", 0, NETDATA_SIGNAL_CHILD }, @@ -209,13 +207,6 @@ void signals_handle(void) { execute_command(CMD_RELOAD_HEALTH, NULL, NULL); break; - case NETDATA_SIGNAL_SAVE_DATABASE: - nd_log_limits_unlimited(); - netdata_log_info("SIGNAL: Received %s. Saving databases...", name); - nd_log_limits_reset(); - execute_command(CMD_SAVE_DATABASE, NULL, NULL); - break; - case NETDATA_SIGNAL_REOPEN_LOGS: nd_log_limits_unlimited(); netdata_log_info("SIGNAL: Received %s. Reopening all log files...", name); diff --git a/daemon/unit_test.c b/daemon/unit_test.c index 7407876723..4951d66c99 100644 --- a/daemon/unit_test.c +++ b/daemon/unit_test.c @@ -2238,7 +2238,6 @@ int test_dbengine(void) rrd_wrlock(); rrdeng_prepare_exit((struct rrdengine_instance *)host->db[0].si); - rrdhost_delete_charts(host); rrdeng_exit((struct rrdengine_instance *)host->db[0].si); rrdeng_enq_cmd(NULL, RRDENG_OPCODE_SHUTDOWN_EVLOOP, NULL, NULL, STORAGE_PRIORITY_BEST_EFFORT, NULL, NULL); rrd_unlock(); @@ -2648,7 +2647,6 @@ void dbengine_stress_test(unsigned TEST_DURATION_SEC, unsigned DSET_CHARTS, unsi freez(query_threads); rrd_wrlock(); rrdeng_prepare_exit((struct rrdengine_instance *)host->db[0].si); - rrdhost_delete_charts(host); rrdeng_exit((struct rrdengine_instance *)host->db[0].si); rrdeng_enq_cmd(NULL, RRDENG_OPCODE_SHUTDOWN_EVLOOP, NULL, NULL, STORAGE_PRIORITY_BEST_EFFORT, NULL, NULL); rrd_unlock(); |