Skip to content

Allow to customize the interval the connection reaper runs #442

Description

@nvivo

Short version: I'd like to set my ConnectionIdleTimeout to 10 seconds, but the reaper currently runs every 60 seconds, which causes lots of connections to being left open for longer than needed.

Long version: I have 900 nodes connecting to a mariadb instance with 64 CPU, and even though each node opens up to 10 connections, and eventually closes them, once we past 3000 connections, CPU started to increase exponentially. 900 nodes had 30% cpu usage, 950 had 70% cpu, 1000 nodes went to 100% and brought down the server. The nodes do the same work, so that didn't make sense.

After spending an hour with AWS support, they recommended closing the idle connections and that solved the problem.

I set a a 10 sec idle timeout, but with 1800 connections, 600 of them are still waiting for longer than necessary. Being able to run the reaper more frequently would allow me to keep using the connection pool, but keep connections open for less time.

The default of 60 seconds is enough for most applications, . But it would be nice to have something like ConnectionIdleReaperInterval=180 by default and be able to change that per app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions