Connection leakage from DMS migration job

We are experiencing a linear growth in idle connections to the database running the Database Migration Services migration job, as shown in the graph below.

The number of idle connections (light blue) increases until the migration job starts failing, and we need to restart the job to release the connections.

Is this expected behavior?

Hi @hanspetter ,

I see that you have concern about the increasing number of idle connections and the impact it’s having on your migration job. It might be possible to have that expected behavior during migration, but it still depends on various factors.

Here are some references that may help you identify the cause and find a possible solution:

  • Connection by status: To get an idea about the overall state from the backend side of your database.
  • Connection Duration: Try to change the parameter of your pool_recycle, which might help limit the idle connection from accumulating.
  • Connection Pools: Check if connection pooling from your side is configured correctly.
  • Supported Flags: Look for max_connections under Cloud SQL Flag to help you determine if the instance you’re using is reaching the default limit.

If you have any doubts or need further assistance, I recommend reaching out to Google Cloud Support for a more in-depth analysis. When contacting them, please provide comprehensive details and include screenshots. This will help them better understand and address your issue.

Hope it helps.