From 8b2c30c51b7c7abb27540e9e309b832ed3c002ac Mon Sep 17 00:00:00 2001 From: Roman Khavronenko Date: Wed, 11 Oct 2023 12:25:54 +0200 Subject: [PATCH] lib/vmselect: bump maxSearchQuerySize to 5MB (#5158) See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5154#issuecomment-1757216612 https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5154 Signed-off-by: hagen1778 --- docs/CHANGELOG.md | 1 + lib/vmselectapi/server.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4f8018f6fd..c74254504c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -42,6 +42,7 @@ The sandbox cluster installation is running under the constant load generated by * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): strip sensitive information such as auth headers or passwords from datasource, remote-read, remote-write or notifier URLs in log messages or UI. This behavior is by default and is controlled via `-datasource.showURL`, `-remoteRead.showURL`, `remoteWrite.showURL` or `-notifier.showURL` cmd-line flags. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5044). * BUGFIX: [vmselect](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): improve performance and memory usage during query processing on machines with big number of CPU cores. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5087) for details. +* BUGFIX: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): bump hard-coded limit for search query size at `vmstorage` from 1MB to 5MB. The change should be more suitable for real-world scenarios and protect vmstorage from excessive memory usage. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5154) for details ## [v1.94.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.94.0) diff --git a/lib/vmselectapi/server.go b/lib/vmselectapi/server.go index b2f7b05d2d..63d2202baa 100644 --- a/lib/vmselectapi/server.go +++ b/lib/vmselectapi/server.go @@ -365,7 +365,8 @@ func (ctx *vmselectRequestCtx) readAccountIDProjectID() (uint32, uint32, error) } // maxSearchQuerySize is the maximum size of SearchQuery packet in bytes. -const maxSearchQuerySize = 1024 * 1024 +// see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5154#issuecomment-1757216612 +const maxSearchQuerySize = 5 * 1024 * 1024 func (ctx *vmselectRequestCtx) readSearchQuery() error { if err := ctx.readDataBufBytes(maxSearchQuerySize); err != nil {