summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorMarkos Fountoulakis <44345837+mfundul@users.noreply.github.com>2020-05-14 11:57:20 +0300
committerGitHub <noreply@github.com>2020-05-14 11:57:20 +0300
commit6393b2f535c993de9f341d2245ad8ba327694281 (patch)
treed53a5b854c4075908c4c3921c372b9d75ba9617d /daemon
parenta606a27f164b1c704d850c838a7b89d6c6e0c17c (diff)
Improve the impact of health code on netdata scalability (#8407)
* Add support for spawning processes without pipes. * Port health_alarm_execute() from mypopen() to netdata_spawn() * Make alarm notifications asynchronous within a single health thread iteration * Initial version of spawn server. * preliminary integration of spawn client with health
Diffstat (limited to 'daemon')
-rw-r--r--daemon/common.h3
-rw-r--r--daemon/main.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/daemon/common.h b/daemon/common.h
index f86e61543f..742ca4a766 100644
--- a/daemon/common.h
+++ b/daemon/common.h
@@ -68,6 +68,9 @@
// netdata agent cloud link
#include "aclk/agent_cloud_link.h"
+// netdata agent spawn server
+#include "spawn/spawn.h"
+
// the netdata deamon
#include "daemon.h"
#include "main.h"
diff --git a/daemon/main.c b/daemon/main.c
index 098ddbac5b..d921f83a86 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -906,6 +906,11 @@ int main(int argc, char **argv) {
else i++;
}
}
+ if (argc > 1 && strcmp(argv[1], SPAWN_SERVER_COMMAND_LINE_ARGUMENT) == 0) {
+ // don't run netdata, this is the spawn server
+ spawn_server();
+ exit(0);
+ }
// parse options
{
@@ -1377,6 +1382,9 @@ int main(int argc, char **argv) {
netdata_threads_init_after_fork((size_t)config_get_number(CONFIG_SECTION_GLOBAL, "pthread stack size", (long)default_stacksize));
+ // fork the spawn server
+ spawn_init();
+
// ------------------------------------------------------------------------
// initialize rrd, registry, health, rrdpush, etc.