feat(syncctl): make sync pod resource limits configurable via env vars#1241
Open
mpanius wants to merge 1 commit intojitsucom:newjitsufrom
Open
feat(syncctl): make sync pod resource limits configurable via env vars#1241mpanius wants to merge 1 commit intojitsucom:newjitsufrom
mpanius wants to merge 1 commit intojitsucom:newjitsufrom
Conversation
Currently, resource limits and requests for sync task pods (source and sidecar containers) are hardcoded. This makes it impossible to adjust resource allocations for smaller clusters or specific workloads without forking the codebase. This change introduces environment variables to configure CPU and memory requests/limits for both source and sidecar containers spawned by syncctl. Default values match the current hardcoded values, so this is a non-breaking change. New environment variables: - SYNCCTL_SOURCE_CPU_REQUEST_MILLICORES (default: 100) - SYNCCTL_SOURCE_CPU_LIMIT_MILLICORES (default: 1000) - SYNCCTL_SOURCE_MEMORY_REQUEST_MI (default: 256) - SYNCCTL_SOURCE_MEMORY_LIMIT_MI (default: 8192) - SYNCCTL_SOURCE_JAVA_OPTS (default: -Xmx7000m) - SYNCCTL_SIDECAR_CPU_REQUEST_MILLICORES (default: 0) - SYNCCTL_SIDECAR_CPU_LIMIT_MILLICORES (default: 500) - SYNCCTL_SIDECAR_MEMORY_REQUEST_MI (default: 0) - SYNCCTL_SIDECAR_MEMORY_LIMIT_MI (default: 4096)
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.
Summary
Sync task pods spawned by syncctl have hardcoded resource limits (source: 1 CPU / 8Gi RAM, sidecar: 500m CPU / 4Gi RAM). This makes it impossible to tune resource allocations for smaller clusters without forking.
This PR adds environment variables to configure CPU/memory requests and limits for both source and sidecar containers. Default values match the current hardcoded values — zero breaking changes.
New environment variables
SYNCCTL_SOURCE_CPU_REQUEST_MILLICORESSYNCCTL_SOURCE_CPU_LIMIT_MILLICORESSYNCCTL_SOURCE_MEMORY_REQUEST_MISYNCCTL_SOURCE_MEMORY_LIMIT_MISYNCCTL_SOURCE_JAVA_OPTS-Xmx7000mSYNCCTL_SIDECAR_CPU_REQUEST_MILLICORESSYNCCTL_SIDECAR_CPU_LIMIT_MILLICORESSYNCCTL_SIDECAR_MEMORY_REQUEST_MISYNCCTL_SIDECAR_MEMORY_LIMIT_MIImportant: SOURCE_MEMORY_LIMIT_MI and SOURCE_JAVA_OPTS must be adjusted together
The source container runs Airbyte connectors (mostly JVM-based). The default
-Xmx7000mreserves 7Gi for JVM heap, with the 8Gi memory limit leaving ~1Gi for non-heap JVM memory (metaspace, thread stacks, native memory).When reducing the memory limit,
SOURCE_JAVA_OPTSmust be adjusted accordingly to prevent OOM kills:-Xmx7000m-Xmx3500m-Xmx1500mMotivation
On small self-hosted clusters the hardcoded 8Gi memory limit on the source container can cause node-level OOM when connectors consume up to the limit, evicting other workloads. There is currently no way to restrict this without modifying the source code.
Changes
bulker/sync-controller/config.go— added 9 config fields withmapstructuretags and defaultsbulker/sync-controller/job_runner.go— replaced hardcoded resource values with config referencesbulker/sync-controller/README.md— documented new environment variables in Configuration tableTest plan
go build ./sync-controller/...)