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

Rollbar 1.1.0->1.2.9 upgrade reduced performance #180

Closed
gdeglin opened this issue Nov 22, 2014 · 9 comments
Closed

Rollbar 1.1.0->1.2.9 upgrade reduced performance #180

gdeglin opened this issue Nov 22, 2014 · 9 comments

Comments

@gdeglin
Copy link

gdeglin commented Nov 22, 2014

Hi. After upgrading to Rollbar 1.2.9 we noticed that NewRelic is reporting an additional 1ms being used by Rollbar that was not previously present. Admittedly this is not that much, but we have some API related actions that get called 300 times per second, so this adds up.

Here's a Newrelic graph with the red area starting after the 1.2.9 upgrade, and then ending after we downgraded back to 1.1.0.

screenshot 2014-11-21 16 04 34

@brianr
Copy link
Member

brianr commented Nov 26, 2014

Thanks @gdeglin . By chance do you have a more detailed trace available? I'm guessing the 1ms is taken up in fetch_scope:

https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/middleware/rails/rollbar.rb#L36

but unclear which part of that is the bulk of the time.

@jondeandres
Copy link
Contributor

This is cause since actually we get the current request data always and not only when there are errors, so it appears in the calling stack for each request, increasing a bit the response time.

It's only 1ms and probably not easy to improve it, but we can take a look :-).

@gdeglin
Copy link
Author

gdeglin commented Dec 2, 2014

@brianr Sorry, I don't have a more detailed trace than this. Sounds like @jondeandres is probably right about the problem though.

Thanks for taking a look! 1.1.0 is working fine, but I want to make sure we don't get caught off guard when you deprecate the old interface. An additional 1ms on all endpoints represents around 15% more CPU load for us.

@brianr
Copy link
Member

brianr commented Dec 3, 2014

Thanks @gdeglin.

@jondeandres perhaps we could gather the request context only when an error happens? Maybe this could be accomplished by having a proc that returns the scope, and then only call that proc when the data is needed.

@jondeandres
Copy link
Contributor

@brianr we can try that solution yes. Actually we do something similar por person_data but not for request_data. Let's see how it works.

Update soon :-)

@brianr
Copy link
Member

brianr commented Dec 10, 2014

Hi @gdeglin -- we've pushed a change to master (8df754d) that should fix the performance issue.

Do you think you'd be able to try it in your environment and see if the performance is the same as in 1.1.0?

You can install it with:

gem 'rollbar', :git => 'git://github.com/rollbar/rollbar-gem.git', :ref => '8df754de95f10dec304a37845e38078c58265a8b'

@gdeglin
Copy link
Author

gdeglin commented Dec 10, 2014

@brianr Looks like the fix worked. Thanks!

@brianr
Copy link
Member

brianr commented Dec 10, 2014

Awesome, thanks for trying it out so quickly! We'll get this out in a new release soon.

@brianr
Copy link
Member

brianr commented Dec 11, 2014

Released in 1.3.0 (now up on rubygems). Thanks again!

@brianr brianr closed this as completed Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants