summaryrefslogtreecommitdiffstats
path: root/aclk
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2022-03-09 19:54:58 +0200
committerGitHub <noreply@github.com>2022-03-09 19:54:58 +0200
commita706491f775fbd959fc97e38cf902f6748855e18 (patch)
treec6f12a0b9b0266acffcf5ba1b33b28a6f2bf4101 /aclk
parent7b77f7c56a40613add8d889032912723bae39c3d (diff)
Improve agent to cloud synchronization performance (#12348)
* Switch to prepare statement when storing active charts / dimensions * Switch to prepare statement when storing chart labels * Switch to prepare statement when doing a node id lookup * Switch to prepare statement when loading the node id for a host * Improve performance by avoiding db query * Use prepare statement when counting pending chart messages to send to the cloud * Delay locking while preparing commands * No need to use buffer, avoid memory allocation overhead * Switch to prepare statement when loading pending chart updates to send to the cloud
Diffstat (limited to 'aclk')
-rw-r--r--aclk/aclk_query.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/aclk/aclk_query.c b/aclk/aclk_query.c
index 4bfa03cd65..b30e6be14b 100644
--- a/aclk/aclk_query.c
+++ b/aclk/aclk_query.c
@@ -58,6 +58,13 @@ static RRDHOST *node_id_2_rrdhost(const char *node_id)
{
int res;
uuid_t node_id_bin, host_id_bin;
+
+ rrd_rdlock();
+ RRDHOST *host = find_host_by_node_id((char *) node_id);
+ rrd_unlock();
+ if (host)
+ return host;
+
char host_id[UUID_STR_LEN];
if (uuid_parse(node_id, node_id_bin)) {
error("Couldn't parse UUID %s", node_id);