Skip to content

Commit

Permalink
increase max response size to 100MiB (netdata#16649)
Browse files Browse the repository at this point in the history
* increase max response size to 100MiB

* do not check the uncompressed message size on aclk
  • Loading branch information
ktsaou authored Dec 21, 2023
1 parent 91989d1 commit 8dac5a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions aclk/aclk_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "../../web/server/web_client_cache.h"

#define WEB_HDR_ACCEPT_ENC "Accept-Encoding:"
#define ACLK_MAX_WEB_RESPONSE_SIZE (30 * 1024 * 1024)

pthread_cond_t query_cond_wait = PTHREAD_COND_INITIALIZER;
pthread_mutex_t query_lock_wait = PTHREAD_MUTEX_INITIALIZER;
Expand Down Expand Up @@ -137,13 +136,6 @@ static int http_api_v2(struct aclk_query_thread *query_thr, aclk_query_t query)
w->response.code = (short)web_client_api_request_with_node_selection(localhost, w, path);
web_client_timeout_checkpoint_response_ready(w, &t);

if(buffer_strlen(w->response.data) > ACLK_MAX_WEB_RESPONSE_SIZE) {
buffer_flush(w->response.data);
buffer_strcat(w->response.data, "response is too big");
w->response.data->content_type = CT_TEXT_PLAIN;
w->response.code = HTTP_RESP_CONTENT_TOO_LONG;
}

if (aclk_stats_enabled) {
ACLK_STATS_LOCK;
aclk_metrics_per_sample.cloud_q_process_total += t;
Expand Down
4 changes: 2 additions & 2 deletions aclk/aclk_tx_msgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static int aclk_send_message_with_bin_payload(mqtt_wss_client client, json_objec
int rc = mqtt_wss_publish5(client, (char*)topic, NULL, full_msg, &freez_aclk_publish5b, full_msg_len, MQTT_WSS_PUB_QOS1, &packet_id);

if (rc == MQTT_WSS_ERR_TOO_BIG_FOR_SERVER)
return HTTP_RESP_FORBIDDEN;
return HTTP_RESP_CONTENT_TOO_LONG;

#ifdef NETDATA_INTERNAL_CHECKS
aclk_stats_msg_published(packet_id);
Expand Down Expand Up @@ -194,7 +194,7 @@ int aclk_http_msg_v2(mqtt_wss_client client, const char *topic, const char *msg_
int rc = aclk_send_message_with_bin_payload(client, msg, topic, payload, payload_len);

switch (rc) {
case HTTP_RESP_FORBIDDEN:
case HTTP_RESP_CONTENT_TOO_LONG:
aclk_http_msg_v2_err(client, topic, msg_id, rc, CLOUD_EC_REQ_REPLY_TOO_BIG, CLOUD_EMSG_REQ_REPLY_TOO_BIG, NULL, 0);
break;
case HTTP_RESP_INTERNAL_SERVER_ERROR:
Expand Down
2 changes: 1 addition & 1 deletion collectors/plugins.d/pluginsd_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define WORKER_RECEIVER_JOB_REPLICATION_COMPLETION (WORKER_PARSER_FIRST_JOB - 3)

// this controls the max response size of a function
#define PLUGINSD_MAX_DEFERRED_SIZE (20 * 1024 * 1024)
#define PLUGINSD_MAX_DEFERRED_SIZE (100 * 1024 * 1024)

#define PLUGINSD_MIN_RRDSET_POINTERS_CACHE 1024

Expand Down

0 comments on commit 8dac5a5

Please sign in to comment.