Repository navigation
perf: enable backend and render optimizations by default - #583
Merged
Merged
Conversation
deniszh
approved these changes
Oct 22, 2026
grzkv
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The five backend/render performance paths already used in production require separate
=1environment overrides. Without those overrides, a new installation or a service-unit cleanup silently selects the previous implementations. Make the application own these defaults so deployment configuration does not need to repeat them.Architecture
This is a startup-default change in the existing application and HTTP backend constructors. It does not add an implementation or change the request/response boundary. Synchronous HTTP, streaming render decoding, native gzip, packed backend points, and stable render batching become default-on. Each existing variable remains an independent
=0opt-out.Native gzip still falls back to Go gzip in portable builds. Packed points still require streaming; stable batching still follows the existing glob mode and configured batch size. The prior buffered decoder, Go transport, unpacked points, and previous batching paths remain available for diagnosis. This preserves the existing compatibility paths without adding another maintained implementation.
This change does not alter the cross-target prefetch scheduling introduced in #582, backend deadlines, connection-pool settings, or the configured render batch size.
Before / after
10Only the literal
0disables a path after this change; other values enable it. The README documents the startup semantics and existing feature dependencies.Usage
Start carbonapi without these previously required environment settings:
For an individual opt-out, for example, set
CARBONAPI_NATIVE_GZIP=0and restart the process.Validation
make test: full race suite with Cairo/native gzip/zlib-ng, followed by backend tests with system zlib and portable Go gzip; passed.golangci-lint run: zero issues.0, exercising the retained opt-out paths.This PR changes defaults; it claims no additional production latency improvement over running the same binary with all five variables set to
1.Rollout and rollback
Deploy this binary while retaining existing
=1service overrides. Then remove the redundant overrides. A new binary with the variables absent selects the same paths as the existing=1configuration.Before reverting to an older binary after removing the service overrides, restore all five
=1settings if the optimized paths should remain enabled. Individual=0opt-outs continue to work with either binary.