Skip to content

Storage monitor

The storage monitor is a check that every Capture Agent runs on its staging database, every 30 minutes by default. It counts the captured change rows that are waiting for the Replicator Service. At a warning level, the agent logs a warning. At a throttle level, it stops reading the source log until SQDR has applied enough of the backlog. This keeps the staging database from filling up when changes are captured faster than SQDR applies them.

You need this page when you want to change those levels, or when an agent logged Log reading has been paused or Storage usage is now above "Warning" level. Use it to:

  • set the levels to what your staging database and source can hold;
  • understand what the agent does at each level, and why its workers show Paused;
  • measure the backlog another way, for example by table space size.

When to change the levels

The warning level is 40 million rows and the throttle level 50 million (see Options). Compare those levels with the room in the staging database and with the room for journal receivers or logs on the source:

  • Lower them when the staging database can't hold that many rows, for example when it has less room than the source's journal receivers or logs.
  • Raise the throttle level when the source keeps its logs only briefly, or the agent stages only a small part of a busy source. While log reading is paused, the backlog moves to the source: journal receivers or logs are kept longer and grow there.
  • Turn the monitor off (smInterval = 0) only if you watch the backlog another way: without it, a stopped Replicator Service or an orphaned subscription lets the backlog grow unnoticed.

Change the levels

  1. On the agent's Configuration tab, set the properties. Saving restarts the agent if it's running.
  2. Watch the Diagnostics tab for the storage messages, or run a Health Check, which reports each time log reading was paused.

What happens at each level

Every smInterval minutes, and shortly after the agent starts, the monitor measures the backlog: by default, the change rows of complete transactions that are staged and waiting to be applied. It compares the number with two levels:

Backlog What happens Log entry (and notification)
reaches smWarningLevel Nothing is paused. SEVERE Storage usage is now above "Warning" level. Current storage count=n
drops below smWarningLevel again INFO Storage usage has dropped below "Warning" level.
reaches smThrottleLevel All workers are paused (their status is Paused on the Summary tab) and a prune cycle starts at once. SEVERE Log reading has been paused. Current storage count=n
drops below smThrottleLevel while paused The workers resume. WARNING Log reading has resumed. Current storage count=n. Storage usage is now at "Warning" level. (or "Normal")

From the warning level up, the agent prunes every minute, ignoring pruneInterval and maintenanceWindow, to remove applied rows as soon as possible. It can only remove rows every subscription has applied, so the backlog drains only as fast as the Replicator Service fetches and applies the changes.

SEVERE entries are emailed if the agent's notification level is SEVERE or lower (see Email notification).

Options

Property What it does Default When to change it
smInterval How often the monitor checks, in minutes; 0 turns it off. 30 Lower it if the backlog can grow from the warning to the throttle level in less than 30 minutes.
smWarningLevel The backlog, in rows, at which a SEVERE warning is logged. 40000000 Set it to what the staging database can hold with room to spare. At about 250,000 rows an hour of about 1 KB each, 40 million rows is about 160 hours and 40 GB.
smThrottleLevel The backlog, in rows, at which log reading is paused. 50000000 Set it below what the staging database can hold. At the same rates, 50 million rows is about 200 hours and 50 GB.
smSQL The query that returns the backlog: one integer or bigint value. the row count described above To measure something else, such as the size of the table space.

The default smSQL query, with SQDR standing for the agent's control schema, as a starting point for your own:

SELECT SUM(ROWCOUNT) FROM SQDR.SQ_TRANSACTIONS
 WHERE ROWCOUNT > 0 AND TXID IS NOT NULL
   AND TXID <= (SELECT MIN(MAXTX) FROM SQDR.SQ_READERS)