<@U04S8PLJWMT> how do I configure cpu/memory reque...
# ask-ai
d
@kapa.ai how do I configure cpu/memory requests/limits for a custom docker connector?
k
You configure CPU/memory for all connectors (including custom Docker ones) using the same resource‑configuration mechanisms; there is no separate mechanism just for “custom” connectors. There are four levels, from lowest to highest precedence: instance‑wide, connector definition, connector‑specific, and connection‑specific.[[Configuring resources](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources)] --- ### 1. Instance‑wide (Helm / Kubernetes) Affects all job containers that aren’t overridden later. Set these in your
values.yaml
(Kubernetes deployment):[[Configuring resources](https://docs.airbyte.com/platform/1.8/operator-guides/configuring-connector-resources)]
Copy code
yaml JOB_MAIN_CONTAINER_CPU_REQUEST: "0.5"   # min CPU (fraction of a core) JOB_MAIN_CONTAINER_CPU_LIMIT: "2"      # max CPU (cores) JOB_MAIN_CONTAINER_MEMORY_REQUEST: "1Gi" JOB_MAIN_CONTAINER_MEMORY_LIMIT: "2Gi"
CPU is expressed as number of cores (or fraction, e.g.
0.5
), memory as Kubernetes‑style quantities (
1Gi
,
2048Mi
, etc.).[[Forum CPU/mem env](https://discuss.airbyte.io/t/1675)] --- ### 2. Connector definition level (all instances of that image) This applies to all connectors of that type (e.g. your custom Docker image). Update the
actor_definition
record in the Airbyte config DB:[[Configuring 1.8](https://docs.airbyte.com/platform/1.8/operator-guides/configuring-connector-resources)] 1. Get the definition id:
Copy code
sql    select *     from actor_definition     where actor_definition.docker_repository like '%<image-name>';
2. Set resource requirements (example for sync jobs):
Copy code
sql    update actor_definition    set resource_requirements = '{      "jobSpecific": [        {          "jobType": "sync",          "resourceRequirements": {            "cpu_limit": "2",            "cpu_request": "2",            "memory_limit": "2048Mi",            "memory_request": "2048Mi"          }        }      ]    }'    where id = '<actor-definition-id>';
--- ### 3. Connection‑specific (this source–destination pair only) Override resources for one connection by updating the
connection
table:[[Conn‑specific 1.8](https://docs.airbyte.com/platform/1.8/operator-guides/configuring-connector-resources#configuring-connection-specific-requirements)] 1. Get the connection id from the URL:
.../workspaces/<workspace-id>/connections/<connection-id>/status
2. Run:
Copy code
sql    update connection    set resource_requirements = '{      "cpu_limit": "2",      "cpu_request": "2",      "memory_limit": "2048Mi",      "memory_request": "2048Mi"    }'    where id = '<connection-id>';
--- ### 4. Enterprise UI / API (per connector or per connection) If you are a Self‑Managed Enterprise customer, you can set “Connector resource allocation” from the Settings tab or via the API; profiles differ for API vs database connectors (e.g. Default, Large, Memory Intensive, Maximum).[[Connector‑specific reqs](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources#configuring-connector-specific-requirements)] --- If you share how you deploy (Docker Compose vs Helm) and your Airbyte version/edition, I can point to the most appropriate of these options for your custom Docker connector.
d
@kapa.ai I set the
sync
job type resource requirements for my custom connector using the configuration API. When I fetch the config back from the configuration API I see the correct resource requirements that I set:
Copy code
"resourceRequirements": {
            "jobSpecific": [
                {
                    "jobType": "sync",
                    "resourceRequirements": {
                        "memory_request": "12Gi",
                        "memory_limit": "16Gi"
                    }
                }
            ]
        }
but when I run the sync I see that the
source
pod is still using default resources. I am using airbyte
1.5.0
deployed using helm. What am I missing here?
k
A message from kapa.ai
You’re very likely running into precedence/override behavior and/or a known quirk with existing DB‑stored requirements, not a problem with the Configuration API payload itself. From the docs, sync job resources are resolved in this order (lowest → highest precedence): instance‑wide → connector definition → connector‑specific → connection‑specific.[[Configuring resources](https://docs.airbyte.com/platform/1.6/operator-guides/configuring-connector-resources)] Only the highest‑precedence non‑empty config is used. Given you’re on 1.5.0 Helm: 1. Check for connection‑level overrides If the
connection.resource_requirements
field is set, it will override your connector‑level
jobSpecific
settings and the pods will use that instead.[[Configuring resources](https://docs.airbyte.com/platform/1.6/operator-guides/configuring-connector-resources)] Connect to the Airbyte DB and inspect:
Copy code
sql    select id, resource_requirements    from connection    where id = '<your-connection-id>';
- If
resource_requirements
is non‑null, either: - update it to your desired values, or - set it to
null
so that the connector‑definition settings apply. 2. **Confirm that you changed the definition, not just the actor** Connector‑definition requirements live on the
actor_definition
record, not on individual actors.[[Configuring resources](https://docs.airbyte.com/platform/1.6/operator-guides/configuring-connector-resources)] Verify in the DB:
Copy code
sql    select id, docker_repository, resource_requirements    from actor_definition    where id = '<definition-id-of-your-custom-connector>';
Ensure this JSON matches what you set via the Configuration API (with
jobSpecific
/
jobType: "sync"
). 3. Ensure instance‑wide / Helm values aren’t the only thing set If neither connection nor definition have
resource_requirements
, Airbyte will fall back to the instance‑wide job settings from Helm (
JOB_MAIN_CONTAINER_*
env vars /
global.jobs.resources
in values.yaml).[[Configuring resources](https://docs.airbyte.com/platform/1.6/operator-guides/configuring-connector-resources)] That’s expected; but they should be overridden as soon as a connection or definition has resource requirements set. 4. Check the actual resolved resources in job logs The platform logs the final resource requirements it is about to use for each container when launching the replication pod.[[Debugging](https://docs.airbyte.com/platform/1.6/operator-guides/configuring-connector-resources#debugging)] In the sync job logs, look for lines like:
Copy code
text    Launching replication pod: ...    [source] image: ... resources: ResourceRequirements(... limits={memory=..., cpu=...}, requests={memory=..., cpu=...} ...)
- If those numbers don’t show `12Gi`/`16Gi`, then the connector‑definition/connection config is not taking precedence (see steps 1–3). - If they do show `12Gi`/`16Gi` but the Kubernetes pod shows defaults, that would indicate a deeper bug not documented in the sources you provided. 5. Be aware of persisted “hard‑coded” requirements There is an open issue where previously persisted actor‑specific resource requirements in the DB continue to override Helm‑level workloads, even when
useConnectorResourceDefaults: false
is set.[[Workload bug](https://github.com/airbytehq/airbyte/issues/68162)] While that issue is described for global workloads, it demonstrates that DB‑stored resource configs take precedence and can be surprising. In your case, double‑check that there is no older/actor‑level or connection‑level resource blob still present that’s overshadowing your new definition‑level config. --- If after checking: -
actor_definition.resource_requirements
has your `12Gi`/`16Gi`, -
connection.resource_requirements
is
null
, - job logs still show default resources for
[source]
, then the knowledge sources don’t describe any additional 1.5.0‑specific bug, and I’d recommend opening a GitHub issue with the job log snippet that shows the resolved
ResourceRequirements
.