> ## Documentation Index
> Fetch the complete documentation index at: https://developers.authlete.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Token Migrator Timing and Intervals

> Explains how quickly Token Migrator 1.4 detects and writes token changes.

This page gives the times measured for Token Migrator 1.4. Actual times depend on the database resources, the migration phase, and the number of in-scope clients and tokens.

<Note>
  All timings on this page were measured with Token Migrator version `1.4`, using a database equivalent in tier to GCP `db-custom-1-3840` (1 vCPU and 3.75 GB of RAM). Databases with fewer resources may perform worse. We recommend that both the source and destination databases have at least these resources.
</Note>

## Token change detection timing

The Token Migrator starts writing a changed token to the destination database within about one minute of the change in the source database. The delay grows with database load, the poll interval, the point in the current iteration, and the number of in-scope clients and source tokens.

| Client count | Token count (in source DB) | Time until token writing starts |
| - | - | - |
| 50,000 | 1,270,000 | 31s - 41s |

## Complete iteration time with no token changes

The Token Migrator queries token changes within specific time periods. An iteration is the completion of the following steps for one time period:

* Detecting in-scope clients
* Detecting token changes within the time period
* Writing token changes within the time period

After these steps complete, the queried time window moves forward as time passes, and this continues until the Token Migrator is stopped.

When there are no token changes, the following table shows the estimated time for one iteration to complete with the configuration described above. This time does not include the poll interval wait at the end of each iteration. Iterations may be much shorter with fewer in-scope clients or fewer tokens in the source database.

| Client count | Token count (in source DB) | Iteration time (excluding poll interval) |
| - | - | - |
| 50,000 | 1,270,000 | 8s - 19s |

## Token migration writing timing

For a single client, the Token Migrator writes tokens at a rate of about 1 million tokens per 70 minutes. Tokens spread across multiple clients are likely to migrate more slowly, depending on the configuration and how many clients have token changes.
