Skip to content

Upgrade Rails 7.1.x to 7.2.x huge performance regression #54351

Open
@kimyu-ng

Description

@kimyu-ng

Description:

After upgrading from Rails 7.1.5 to 7.2.2.1, along with upgrading other gems, I have observed significant performance degradation when running 8.3k+ tests in 12 parallel containerized environment. The same workload that previously took ~15 minutes now consistently takes ~40 minutes. Below are the details of my environment:

Environment Details:

Ruby Version: 3.3.6
Rails Versions Tested: 7.1.5, 7.2.2.1
Number of Containers: 12
Workload: Splitting 12 containers running Rspec tests

Observations:

  1. Baseline Performance with Rails 7.1.5 (before any upgrade):

    • Rails Version: 7.1.5
    • Configuration: config.load_defaults 7.1
    • Time Taken: ~15 minutes
  2. Upgraded Performance with Rails 7.2.2.1 and Configurations Tested:

    • Rails Version: 7.2.2.1
    • Configurations Tested:
      • config.load_defaults 7.2, YJIT enabled
      • config.load_defaults 7.2, YJIT disabled
      • config.load_defaults 7.1, YJIT disabled
    • Time Taken: ~40 minutes consistently across configurations
  3. Isolating the Rails Upgrade:

    • Retested with Rails 7.1.5 and config.load_defaults 7.1, but with all other gem upgrades intact.
    • Time Taken: ~15 minutes

Resource Utilization:

Attached are graphs showing CPU and RAM usage across the test runs.
Image

Image

Expected Behavior:

The workload should not see a 2.5x increase in runtime when upgrading to Rails 7.2.2.1. Performance should be similar.

Actual Behavior:

The workload runtime increases from ~15 minutes to ~40 minutes post-upgrade to Rails 7.2.2.1, regardless of the configurations tested.

What additional debugging steps can I take to pinpoint the cause?

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