Skip to content

Performance regression in checking out connections between Rails 4.2 and 6.1 #1140

Open
@skunkworker

Description

@skunkworker

I have noticed a large performance regression between Rails 4.2 and 6.1 when quickly checking out a large number of connections.

https://github.com/skunkworker/jruby_activerecord_checkout_regression

The included benchmark creates connection pools, randomly selects a pool, opens N connections, runs select 1=1 then checks in the connections. Connected to the postgres database (which should be empty).

When the Rails log level is set to :debug. Rails 4.2 is up to 5x faster than 6.1. When using MRI, Rails 6.1 goes back to a normal amount of time.
When the Rails log level is set to :info. Rails 4.2 is 1.5x faster than 6.1.

I'll be doing further investigation into multi database and multi schema with large tables to see if I can reproduce some of the behavior we have been seeing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions