<@U04S8PLJWMT> I am running airbyte on a docker co...
# ask-ai
p
@kapa.ai I am running airbyte on a docker container within we use kubernetes. Our syncs keep getting OOMkilled. They have 30Gi memory and the container reaches the max in a very short time. What could be the problem?
k
A few common causes from our docs/issues: - Under-provisioned/incorrect job resource settings, so pods request too little and get OOMKilled despite large node memory. Set job requests/limits explicitly for each job type (sync/check/discover/spec) via environment variables, not just JOB_MAIN_*. On Kubernetes, define CHECK_*, DISCOVER_*, SPEC_*, and SIDECAR_* requests/limits as well, or use Helm values to propagate them (e.g., global.env_vars). Otherwise K8s falls back to low defaults and OOMs during checks/discovery/syncs ([Cannot use Airbyte on Kubernetes due to OOM…](https://github.com/airbytehq/airbyte/issues/48816)). - Instance-level variables sometimes aren’t applied as expected; setting per-connection or per-connector resources may work when global settings are ignored. Verify effective resources in the job log line “Creating docker container … with resources …” and adjust accordingly ([Airbyte is ignoring JOB_MAIN_CONTAINER_MEMORY_REQUEST…](https://github.com/airbytehq/airbyte/issues/30814)). - Some connectors or large tables can exhaust heap even with high limits (Java heap space errors). For large sources (e.g., CockroachDB) users reported OOM with big tables; consider breaking up syncs or tuning resources per-connection ([CockroachDB OOM reports](https://github.com/airbytehq/airbyte/issues/16693), [another OOM case](https://github.com/airbytehq/airbyte/issues/32510)). - Worker/resource leaks: long-lived worker pods can accumulate memory over time; restarting the worker or ensuring autoscaling/rotation can mitigate while a fix is pursued ([Worker pod keep consuming memory over time](https://github.com/airbytehq/airbyte/issues/56944)). - Stripe source recent versions had memory growth in some streams; pinning to a known-good version (e.g., 5.10.1) helped some users until fixes land ([source-stripe memory leak](https://github.com/airbytehq/airbyte/issues/60813)). - Right-size concurrency. Too many concurrent syncs can starve memory/CPU; cap with MAX_SYNC_WORKERS/MAX_CHECK_WORKERS and adjust worker replicas and job pod resources via Helm values (values.yaml jobs.resources and worker maxSyncWorkers/checkWorkers) ([Scaling Airbyte](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte), [Scaling Airbyte (Next)](https://docs.airbyte.com/platform/next/enterprise-setup/scaling-airbyte)). Quick checks/actions: - Confirm job logs show your intended memory request/limit for the specific operation (check/discover/sync). If not, set the full set of env vars (JOB_*, CHECK_*, DISCOVER_*, SPEC_*, SIDECAR_*) or the corresponding Helm values so pods get adequate memory ([Cannot use Airbyte on Kubernetes due to OOM…](https://github.com/airbytehq/airbyte/issues/48816)). - Reduce concurrency (MAX_SYNC_WORKERS/MAX_CHECK_WORKERS) and/or increase worker replicas as needed ([Scaling Airbyte](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte)). - If OOMs are tied to a specific connector/version (e.g., Stripe), try the previously stable version cited in the issue while a fix is investigated ([source-stripe memory leak](https://github.com/airbytehq/airbyte/issues/60813)). - If worker memory grows over days, roll the worker periodically while tracking the open leak issue ([Worker pod memory growth](https://github.com/airbytehq/airbyte/issues/56944)).
p
@kapa.ai we have had a limit of 10Gi for months and it worked perfectly. But then we increased it to 14 and since that the pods are getting oomkilled
k
A message from kapa.ai
Two likely causes based on known behaviors/issues: - Different env vars per job type. When you changed limits, only JOB_MAIN_* may have been updated, but check/discover/spec/sync pods each read their own env vars. If those weren’t set, Kubernetes may be applying much lower defaults (via LimitRange), causing OOM once the jobs restart and pick up new scheduling. Set all of: JOB_MAIN_CONTAINER_{MEMORY,CPU}_{REQUEST,LIMIT}, CHECK_JOB_*, DISCOVER_JOB_*, SPEC_JOB_*, and SIDECAR_* (via Helm global.env_vars) and verify in job logs the “Creating docker container … with resources …” line reflects your intended memory (values aren’t always applied unless set per-job-type) ([Cannot use Airbyte on Kubernetes due to OOM…](https://github.com/airbytehq/airbyte/issues/48816), [Airbyte is ignoring JOB_MAIN_CONTAINER_MEMORY_REQUEST…](https://github.com/airbytehq/airbyte/issues/30814)). - Memory growth/leaks in long‑lived pods (worker/workload-launcher). Increasing limits can mask gradual growth until a threshold; after change, pods may stay up longer and hit OOM. Users reported worker/workload-launcher memory increasing over time and requiring periodic restarts while fixes are investigated ([Worker pod keep consuming memory over time](https://github.com/airbytehq/airbyte/issues/56944)). Also confirm: - Source batch behavior can require substantial RAM (source reads up to 10k records in memory). If data shape changed (wider rows), required RAM rises. Consider per-connection resource overrides if a single sync regressed ([Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale)). Next steps: - Set/align all job-type env vars for memory requests/limits; redeploy, then check the job log line to confirm effective memory. - If OOMs persist on long-running clusters, roll worker/workload-launcher periodically and monitor for steady growth. - If tied to a specific connector/version, check for known memory regressions and pin to a stable version as a temporary workaround (example: source-stripe 5.11–5.12 reported growth) ([source-stripe memory leak](https://github.com/airbytehq/airbyte/issues/60813)).
p
@kapa.ai where should i set these env vars?
Copy code
global:
  env_vars:
    JOB_MAIN_CONTAINER_CPU_REQUEST: ...
    JOB_MAIN_CONTAINER_CPU_LIMIT: ...
    JOB_MAIN_CONTAINER_MEMORY_REQUEST: ...
    JOB_MAIN_CONTAINER_MEMORY_LIMIT: ...
    CHECK_JOB_MAIN_CONTAINER_CPU_REQUEST: ...
    CHECK_JOB_MAIN_CONTAINER_CPU_LIMIT: ...
    CHECK_JOB_MAIN_CONTAINER_MEMORY_REQUEST: ...
    CHECK_JOB_MAIN_CONTAINER_MEMORY_LIMIT: ...
    DISCOVER_JOB_MAIN_CONTAINER_CPU_REQUEST: ...
    DISCOVER_JOB_MAIN_CONTAINER_CPU_LIMIT: ...
    DISCOVER_JOB_MAIN_CONTAINER_MEMORY_REQUEST: ...
    DISCOVER_JOB_MAIN_CONTAINER_MEMORY_LIMIT: ...
    SPEC_JOB_MAIN_CONTAINER_CPU_REQUEST: ...
    SPEC_JOB_MAIN_CONTAINER_CPU_LIMIT: ...
    SPEC_JOB_MAIN_CONTAINER_MEMORY_REQUEST: ...
    SPEC_JOB_MAIN_CONTAINER_MEMORY_LIMIT: ...
    SIDECAR_MAIN_CONTAINER_CPU_REQUEST: ...
    SIDECAR_MAIN_CONTAINER_CPU_LIMIT: ...
    SIDECAR_MAIN_CONTAINER_MEMORY_REQUEST: ...
    SIDECAR_MAIN_CONTAINER_MEMORY_LIMIT: ...
k
A message from kapa.ai
Set them in your Helm values.yaml for your Kubernetes deployment. - For Helm chart V1: place them under global.env_vars (as in your snippet). This is how users worked around per-job-type defaults to avoid OOMs during check/discover/spec jobs ([Cannot use Airbyte on K8s due to OOM…](https://github.com/airbytehq/airbyte/issues/48816)). - For Helm chart V2: many JOB_* env vars now have first‑class fields. Prefer the V2 equivalents (e.g., global.workloads.resources.mainContainer.memory.request/limit) instead of env vars. Per the migration table, set: - JOB_MAIN_CONTAINER_{CPU,MEMORY}_{REQUEST,LIMIT} → global.workloads.resources.mainContainer.{cpu,memory}.{request,limit} - Job scheduling/node selectors moved under global.jobs.kube… (see docs). If a variable has no V2 equivalent, keep using extraEnv in the relevant service. ([Upgrade to Helm chart V2 – Update your values.yaml](https://docs.airbyte.com/platform/next/deploying-airbyte/chart-v2-community#update-your-valuesyaml-file), [Enterprise V2 mapping](https://docs.airbyte.com/platform/next/enterprise-setup/chart-v2-enterprise#update-your-valuesyaml-file)). If you remain on V1 or need per‑job‑type overrides (CHECK_*, DISCOVER_*, SPEC_*, SIDECAR_*), keep them under global.env_vars in values.yaml as shown in your snippet, then redeploy. This addressed OOMs when Kubernetes otherwise fell back to low LimitRange defaults during checks/discovery ([Cannot use Airbyte on K8s due to OOM…](https://github.com/airbytehq/airbyte/issues/48816)). Note: Instance‑wide settings may be overridden by connector/connection‑level resource requirements; verify the effective resources in job logs and adjust scope as needed ([Configuring connector resources](https://docs.airbyte.com/platform/next/operator-guides/configuring-connector-resources)).
p
these are our settings, is something wrong with it? @kapa.ai global: jobs: resources: limits: cpu: 4 memory: 10Gi requests: cpu: 800m memory: 1.7Gi
k
A message from kapa.ai
Short answer: the block is valid Helm V1-style, but it only sets instance-wide defaults for the “main” container. Two common pitfalls: - Other job types/sidecars not covered: check/discover/spec and sidecar containers can ignore these unless you also set their specific env vars (CHECK_*, DISCOVER_*, SPEC_*, SIDECAR_*). Without them, K8s may apply low defaults (or different limits), causing OOMs even if global.jobs.resources looks generous (users resolved OOMs by setting all per-job env vars via global.env_vars) ([Cannot use Airbyte on Kubernetes due to OOM…](https://github.com/airbytehq/airbyte/issues/48816)). - Effective resources can be overridden: connector/connection-level resource requirements can supersede instance-wide defaults. Verify the effective values in job logs and adjust where needed ([Configuring connector resources](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources)). Recommendations: - Keep your global.jobs.resources as base, and additionally set: - JOB_MAIN_CONTAINER_{CPU,MEMORY}_{REQUEST,LIMIT} - CHECK_JOB_MAIN_CONTAINER_{CPU,MEMORY}_{REQUEST,LIMIT} - DISCOVER_JOB_MAIN_CONTAINER_{CPU,MEMORY}_{REQUEST,LIMIT} - SPEC_JOB_MAIN_CONTAINER_{CPU,MEMORY}_{REQUEST,LIMIT} - SIDECAR_MAIN_CONTAINER_{CPU,MEMORY}_{REQUEST,LIMIT} via values.yaml under global.env_vars (Helm V1), then restart pods so env changes take effect ([Cannot use Airbyte on Kubernetes due to OOM…](https://github.com/airbytehq/airbyte/issues/48816), [Excessive cpu/memory limits thread – configmap/env refresh](https://github.com/airbytehq/airbyte/issues/35749)). - Confirm in each job’s logs that Airbyte prints the intended cpu/memory for main/sidecars. If not, consider per-connector/connection overrides as needed ([Configuring connector resources](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources)). - If you run many concurrent syncs, cap concurrency to avoid scheduling pressure and stuck/oom jobs (MAX_SYNC_WORKERS/MAX_CHECK_WORKERS) ([Scaling Airbyte](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte)).
p
@kapa.ai do I need to set the LIMIT and REQUEST? or is LIMIT enough?
k
A message from kapa.ai
Set both. - Requests control scheduling (Kubernetes guarantees at least this much). If requests are too low, pods may be placed on nodes without enough headroom and hit OOM even if you set a higher limit. - Limits cap usage. Without matching/appropriate requests, the effective scheduling can still be insufficient. Airbyte docs recommend configuring both request and limit for CPU and memory at the instance level (and overriding as needed) in values.yaml: JOB_MAIN_CONTAINER_CPU_REQUEST/LIMIT and JOB_MAIN_CONTAINER_MEMORY_REQUEST/LIMIT (and similarly for other job types if used) ([Configuring connector resources](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources)). Users who only set limits via jobs.resources saw OOMs until they specified per-job requests and limits (CHECK_*, DISCOVER_*, SPEC_*, SIDECAR_*) via env vars in values.yaml ([Cannot use Airbyte on Kubernetes due to OOM…](https://github.com/airbytehq/airbyte/issues/48816)).
p
@kapa.ai is it a bad idea to set request and limit at the same size?
k
A message from kapa.ai
Short answer: it’s acceptable, and often recommended for predictability. - Airbyte’s docs show setting both requests and limits together for job containers (e.g., cpu and memory requests/limits in values.yaml), implying you should define both and can set them equal when you want guaranteed headroom and consistent scheduling for connectors ([Configuring connector resources](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources)). - The enterprise scaling guides likewise illustrate specifying both request and limit fields for connector pods at the instance level, which you may tune up or down as needed ([Scaling Airbyte](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte)). Trade-offs: - Setting request = limit ensures the scheduler reserves exactly what the pod can use, reducing surprise OOMs from under-requesting. - It may reduce cluster bin-packing efficiency versus lower requests, so schedule fewer concurrent jobs or adjust MAX_SYNC_WORKERS accordingly if needed ([Scaling Airbyte](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte)). If OOMs persist, also set per-job-type vars (CHECK_*, DISCOVER_*, SPEC_*, SIDECAR_*) so those phases don’t fall back to unintended defaults ([Cannot use Airbyte on K8s due to OOM](https://github.com/airbytehq/airbyte/issues/48816)).
p
@kapa.ai is this ok? global: env_vars: #JOB_MAIN_CONTAINER_CPU_REQUEST: ... #JOB_MAIN_CONTAINER_CPU_LIMIT: ... JOB_MAIN_CONTAINER_MEMORY_REQUEST: 1.7Gi JOB_MAIN_CONTAINER_MEMORY_LIMIT: 10Gi #CHECK_JOB_MAIN_CONTAINER_CPU_REQUEST: ... #CHECK_JOB_MAIN_CONTAINER_CPU_LIMIT: ... CHECK_JOB_MAIN_CONTAINER_MEMORY_REQUEST: 1.7Gi CHECK_JOB_MAIN_CONTAINER_MEMORY_LIMIT: 10Gi #DISCOVER_JOB_MAIN_CONTAINER_CPU_REQUEST: ... #DISCOVER_JOB_MAIN_CONTAINER_CPU_LIMIT: ... DISCOVER_JOB_MAIN_CONTAINER_MEMORY_REQUEST: 1.7Gi DISCOVER_JOB_MAIN_CONTAINER_MEMORY_LIMIT: 10Gi #SPEC_JOB_MAIN_CONTAINER_CPU_REQUEST: ... #SPEC_JOB_MAIN_CONTAINER_CPU_LIMIT: ... SPEC_JOB_MAIN_CONTAINER_MEMORY_REQUEST: 1.7Gi SPEC_JOB_MAIN_CONTAINER_MEMORY_LIMIT: 10Gi #SIDECAR_MAIN_CONTAINER_CPU_REQUEST: ... #SIDECAR_MAIN_CONTAINER_CPU_LIMIT: ... SIDECAR_MAIN_CONTAINER_MEMORY_REQUEST: 1.7Gi SIDECAR_MAIN_CONTAINER_MEMORY_LIMIT: 10Gi
k
A message from kapa.ai
Mostly, yes—but two notes: - Set CPU requests/limits too, not just memory. Airbyte recommends configuring both CPU and memory requests/limits for each job type; otherwise scheduling can be suboptimal and still lead to OOM/risky placement (use the matching JOB_*, CHECK_*, DISCOVER_*, SPEC_*, and SIDECAR_* CPU vars alongside memory) (Configuring connector resources). - Verify your Helm chart version. In chart v2, some JOB_* env vars have dedicated fields; main-container resources map to global.workloads.resources.mainContainer.{cpu,memory}.{request,limit}. If you stay on v1, your global.env_vars block is the correct place for these per-job envs (Helm v2 mapping; Cannot use Airbyte on K8s due to OOM). If you proceed with v1 and env vars, your snippet covers memory for all job types and the sidecar. Add the CPU counterparts for each to be thorough. References: (Configuring connector resources), (Upgrade to Helm chart V2 – Update your values.yaml file), (Cannot use Airbyte on Kubernetes due to OOM…).