When a Capture Agent falls behind¶
A Capture Agent is congested when one of its workers has fallen behind the source: the changes it's reading now
were made on the source more than congestedThreshold minutes ago (5 by default). The worker then shows
Running(Congested) on the Summary tab, the agent shows Warning, and the
Dashboard counts the agent as congested. Use this page to:
- tell whether the agent is catching up or stuck;
- find the cause and what to do about it;
- stop warnings for batch jobs the agent always absorbs, or for a time zone difference.
Congestion is a warning: nothing is lost and no baseline is needed. The agent keeps reading and staging, and the warning clears by itself once the worker catches up.
Check whether the agent is catching up¶
Run a Health Check: it tells whether the agent is catching up or stuck. Or follow the worker's Log Position on the Summary tab and its T2 Lag time on the Statistics tab: the lag is the time between a change on the source and its staging.
When the lag exceeds congestedThreshold minutes, the agent logs a WARNING:
Workernameis now congested (lagtime >nminutes).
When the lag drops to uncongestedThreshold minutes (1 by default) or less, the agent logs
Workernameis no longer congested. The gap between the thresholds keeps the status from flickering. Congestion
isn't checked for the first congestedThreshold minutes after the agent starts. The warnings are emailed only if the
agent's notification level is WARNING (see
Email notification).
A stuck worker isn't shown as congested. The lag is measured only from the log records a worker reads. A worker that reads nothing (T1 Log Entries stays at 0 on the Statistics tab), for example because it's stuck or can't reach the source log, reports no lag. To catch such a stall, check that the worker's Log Position moves while the source is busy, or run a Health Check.
Changes arrive late, but the agent isn't congested¶
Congestion only measures reading the source log and staging the changes (Tier 1, the source, to Tier 2, Stelo Capture). Changes can also arrive late without the agent being congested:
- the Replicator Service (Tier 3) is stopped, the incremental group is paused, or the destination (Tier 4) is slow;
- the storage monitor paused log reading because too many rows wait in the staging database.
Common causes and what to do¶
The causes Stelo Support finds most often when an agent is congested or paused, or changes reach the destination late. Some aren't congestion in the strict sense (see Changes arrive late, but the agent isn't congested), but look the same from the destination.
| Symptom | Cause | What to do |
|---|---|---|
Workers show Paused on the Summary tab; the log has the SEVERE entry Log reading has been paused. |
The staged backlog reached smThrottleLevel (50,000,000 rows by default), usually because incremental groups, or their source or destination, were paused for days, or a destination was unreachable, so nothing was applied or pruned. | Resume the groups or fix the destination: the backlog drains as the changes are applied, and the workers resume below the level. If the server has the disk space, raise smThrottleLevel and smWarningLevel to give the destination time to catch up. See Storage monitor. |
| Rows waiting grows for every table of one incremental group, while other groups keep up. | A member whose changes can't be applied stops its whole group: the group retries and shows a polling error naming the member. | Fix the member's error, or move it to a group of its own so that the rest of the group applies again, then fix it and move it back. See Designing groups. |
| The agent was fast enough before and is now congested, with no change in source activity. | The core license limits each Capture Agent to its licensed number of processors, 2 without a core license. When a temporary license with more cores expires, agents fall back to the lower count at their next start. | Check the licensed cores on the Dashboard (View per-core…), and ask Stelo for a license that matches the workload. See License. |
| SQL Server source: the worker stays behind, or rows stop being staged, with a large backlog. | The agent inserts change data into the staging database with several threads (numInsertThreads, 5 by default). | Stelo Support has resolved such cases by setting numInsertThreads to 1. Contact Stelo Support before you change it. |
| The destination is hours behind, and Rows waiting grows steadily through the day. | The incremental groups' Poll Interval was set to hours (12 or 24) instead of minutes, so changes are fetched rarely and pile up in the staging database. | Set the Poll Interval back to the default of 3 minutes (see Group properties); the backlog then takes a while to drain. If changes must be applied only once or twice a day, expect the backlog to build up between polls, and set the storage levels for it. |
| A burst of millions of changes on one table (a purge, a reload, a mass update, month-end processing). | The agent must read and stage every changed row, and the group apply them, one by one. | For planned bulk work on a table, take its subscription offline before the job and online afterwards, which runs a new baseline of the table instead. Take offline tables you don't need to replicate. See also below. |
| The storage backlog stays high although the destination is up to date. | With pruneRetention, applied changes are kept for that many hours, and they still count toward the storage monitor's backlog. | Lower pruneRetention (0, the default, prunes changes as soon as they're applied), or raise the storage levels to allow for the retained rows. See Configuring pruning. |
A burst of activity on the source¶
The most common cause is a large batch job on the source, which gives the agent far more log records to read than usual.
- On the Statistics tab, look for a spike in T1 Log Entries at the time the lag started.
- Follow the worker's Log Position on the Summary tab, or run a Health Check: if the position advances and the backlog shrinks, the agent is catching up and clears the congestion by itself, unless the source keeps changing faster than the agent can stage.
If catching up takes too long, a new baseline of the affected tables can be quicker than waiting for every change.
A time zone difference¶
If the Stelo VM and the source database are in different time zones, the lag is off by the difference and the agent can look congested when it isn't.
What you see: the agent always shows as congested (warning icon) although nothing is behind, except for the first minutes after each restart, while congestion isn't checked yet.
What to do: raise both thresholds by the time difference, in minutes (60 per hour of difference). For example, when
the source host is one hour ahead of the Stelo VM, add congestedThreshold with the value 65 and
uncongestedThreshold with 61 on the agent's Configuration tab (see Options), and Save, which
restarts the agent.
Many rollbacks on the source¶
A source job that keeps starting a transaction, changing a row and rolling it back fills the log with records the agent must read, while few changes reach the destination. The agent reads a lot (T1 Read KBytes high on the Statistics tab) but processes few T1 Log Entries, and its log position advances very slowly.
To find the job (Db2 for i):
- On the Summary tab, note the journal receiver and position the agent is reading.
- On the IBM i, display the journal at that receiver and position with
DSPJRN: one job repeats the same pattern on one table (start of transaction, insert, the undo of the insert, rollback).DSPJRNalso shows the table. WRKOBJ <receiver-library>/*ALL *JRNRCVshows how many journal receivers are waiting to be read.
To catch up:
- Take the table's subscription offline in the SQDR Control Center, so that the agent skips its changes. The agent then catches up with the other tables.
- Once the agent reads recent receivers again, take the subscription online. The table gets a new baseline (automatically or when you run it, depending on the group's Automatic Snapshot).
- Have the job's owner stop the repeated rollbacks.
A shorter pollSleepTime (for example 500 ms instead of the default 5000) can help a little, but not enough to absorb such a backlog.
Options¶
Set these on the agent's Configuration tab (see Add Configuration Property). Saving restarts the agent.
| Property | What it does | Default | When to change it |
|---|---|---|---|
congestedThreshold |
Minutes of lag above which a worker is congested. A value below 1 is treated as 5. | 5 | Raise it if the source regularly runs batch jobs the agent always absorbs, so that they don't raise warnings. |
uncongestedThreshold |
Minutes of lag at or below which a worker is no longer congested. If it isn't lower than congestedThreshold, 0 is used. |
1 | Rarely. Keep it below congestedThreshold. |