mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
app/vmauth: allow buffering request body before proxying it to the backend
This should help reducing load on backends when many concurrent clients send requests over slow networks (for example, when many IoT devices send metrics to vmauth over slow connections). Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/10309 This commit is based on top of https://github.com/VictoriaMetrics/VictoriaMetrics/pull/10310 Thanks to @makasim for the initial idea.
This commit is contained in:
@@ -617,6 +617,13 @@ func (rwa *responseWriterWithAbort) Flush() {
|
||||
flusher.Flush()
|
||||
}
|
||||
|
||||
// Unwrap returns the original ResponseWriter wrapped by rwa.
|
||||
//
|
||||
// This is needed for the net/http.ResponseController - see https://pkg.go.dev/net/http#NewResponseController
|
||||
func (rwa *responseWriterWithAbort) Unwrap() http.ResponseWriter {
|
||||
return rwa.ResponseWriter
|
||||
}
|
||||
|
||||
// abort aborts the client connection associated with rwa.
|
||||
//
|
||||
// The last http chunk in the response stream is intentionally written incorrectly,
|
||||
|
||||
Reference in New Issue
Block a user