Skip to content

Reduce locking in VariableTableManager#initObjectId #1400

@nirvdrum

Description

@nirvdrum

While running a production Rails 3.2 app in JRuby 1.7.10 with 100 concurrent requests I saw a lot of blocked threads waiting on the lock in VariableTableManager#initObjectId. It appears that Rails makes excessive use of object_id and this seems to be hurting concurrency.

I'm seeing the source of contention in a couple places. One that pops up a fair bit is ActionView's template cache:

https://github.com/rails/rails/blob/v3.2.16/actionpack/lib/action_view/template/resolver.rb#L70-L90

Another seems to be in the Rails router when generating routes for the path/url helper methods. It seems to be in the journey gem, although the call to object_id isn't immediately clear:

https://github.com/rails/journey/blob/aa7e7438eb30516c3b72555e6f355c25d6a9c8ed/lib/journey/formatter.rb#L13-L47

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions