Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce locking in VariableTableManager#initObjectId #1400

nirvdrum opened this Issue Jan 13, 2014 · 1 comment


None yet
2 participants
Copy link

nirvdrum commented Jan 13, 2014

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:

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:


This comment has been minimized.

Copy link
Contributor Author

nirvdrum commented Jan 14, 2014

I tried removing the "synchronized" modifier from VariableTableManager#initObjectId and that didn't seem to blow things up. Of course, race conditions can be hard to surface. But it went away as a choke point.

@headius headius closed this in ce9b7f8 Jan 14, 2014

@enebo enebo added this to the JRuby 1.7.11 milestone Feb 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.