How imports are split
How gateways split one import into many short requests, and how to set requestTimeoutSeconds and parallel for the platform you run them on.
Some gateways import a large source system in many short requests instead of one long one. Every request does part of the work and passes the rest on to the next request in a cursor. This keeps every request within the limits of the platform the gateway runs on, and keeps memory use flat however large the source system is.
These gateways need SDK version 2 in the custom gateway configuration of the source. Each gateway's documentation says whether it works this way.
How it works
The first request collects everything that is shared by the whole import, such as users and groups, and splits the remaining work into chains of items.
Each chain is worked through by a series of requests, the parts. A part works on several items at once and, when its time is up, hands the items it did not get to on to the next part of its chain.
Chains run side by side: Elimity Insights keeps one request open per chain. How many chains there are is set with
parallel.
Every part sends a line to the source's logs when it starts, a line saying it is still working whenever it has nothing else to send for two minutes, and a summary at the end. Proxies and ingresses that cut connections that stay silent for a few minutes therefore never see a silent request.
Configuration values
requestTimeoutSeconds
Yes
The longest one request to the gateway may take, in seconds. At least 120; we recommend 600.
parallel
No
How many chains the import runs as: false (default) is one, true is eight, or a number.
requestTimeoutSeconds
This is a hard limit on every request. A part stops starting new items once the time left is shorter than its items have taken so far, and stops whatever is still running 10 seconds before the limit: what finished is imported, the rest goes to the next part. An item only sends its data once it is complete, so a stopped item never leaves partial data behind.
Set it below the request limits of the platform the gateway runs on (see below). If not a single item can finish within the limit, the import fails with an error that names the item, for example:
No ... finished within the request timeout of 120 s (the first was ...). Raise requestTimeoutSeconds, keeping it within the request limit of the platform the gateway runs on.
parallel
One chain (parallel: false, the default)
The whole import is a single chain. Elimity Insights sends one request at a time, and only sends the next one once the previous one has ended:
requestTimeoutSecondsdecides how many parts the import takes. Every part works until its limit, or until the items run out, and hands the rest on. An import with about 20 minutes of work runs as 2 parts with600, or as about 10 parts with120.The total time is the sum of the parts. A lower limit does not slow the import down by itself, but every part starts by reading its cursor and signing in to the source system again, so many very short parts waste some time.
Only one gateway instance is busy at any moment, and Elimity Insights has only one connection to the gateway open. This suits a gateway on a single fixed machine, or a platform where scaling out is not wanted.
The platform's request limits still apply to every part, so
requestTimeoutSecondshas to stay within them here too.
Several chains (parallel: true or a number)
The items are dealt over that many chains, and Elimity Insights works on all chains at the same time, each one part after the other as above. This finishes the import sooner, but only up to a point:
Chains share the gateway instance they run on. More chains help most when the platform starts extra instances for them (Cloud Run and Azure Container Apps do, when their scaling allows it).
The source system's own rate limits stay the same. Once those are reached, more chains do not make the import faster.
If one chain takes too long, try true (eight chains), and only go higher after measuring.
Choosing the values per platform
Platform
Set on the platform
requestTimeoutSeconds
Google Cloud Run
Request timeout of the service (up to 3600 s), e.g. 900
Below the request timeout, e.g. 600
Azure Container Apps
Ingress request timeout and terminationGracePeriodSeconds, e.g. both 10 minutes
At most both, e.g. 600
Behind a proxy or load balancer
Its total request or response timeout, if it has one
Below that timeout
On Google Cloud Run, the request timeout counts from when a request arrives, requestTimeoutSeconds from when the gateway starts handling it. Starting a new instance can take half a minute, so keep the service's request timeout at least a minute above requestTimeoutSeconds.
On Azure Container Apps, two settings matter, and both should be in line with requestTimeoutSeconds:
The ingress request timeout. The ingress ends a request that has sent nothing for this long (4 minutes on the default ingress; configurable with premium ingress). The parts' still-working lines, at least every two minutes, keep requests within it.
terminationGracePeriodSeconds. The platform removes surplus replicas a few minutes after the load drops, and it does not know which ones still have a request open. A replica that is being removed getsterminationGracePeriodSecondsto finish (30 seconds by default). WithrequestTimeoutSecondsat most the grace period, every running request can still finish on time.
For example, set all three to 3 minutes (requestTimeoutSeconds = 180), or all three to 10 minutes (600).
Troubleshooting
Invalid configuration: requestTimeoutSeconds is required: ...
The configuration value is missing. Add requestTimeoutSeconds (at least 120).
requestTimeoutSeconds must be at least 120, not ...
Raise the value.
No ... finished within the request timeout of ... s
Not a single item could finish within the limit, usually because the source system is throttling. Raise requestTimeoutSeconds, keeping it within the platform's limits.
... stopped at the request timeout of ... s; ... left for part ...
Not an error: the part reached its limit and the next part continues.

