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
CPU and Average Response increased after version 7 #990
Comments
Hi @rodolfobandeira. Thanks for this useful info. We're actively working on this but @kyrylo (who leads this library's development) is currently on vacation hence the delays, sorry for the inconvenience. It's possible that what you are seeing is what @kyrylo addressed in airbrake/airbrake-ruby#488, those two PRs are on master but are not yet released to Rubygems: https://github.com/airbrake/airbrake-ruby/blob/master/CHANGELOG.md#master. Exactly which version of We'll get this resolved but it may take a couple of weeks. In the meantime, a couple of possible options are to a) try the versions on Thanks for your patience and your helpful report! |
Thanks @zefer. Version 7 works fine for what we need here so far so no rush. I updated the first message with more details. What puzzles me is that even after disabling |
Excellent, many thanks @rodolfobandeira, we'll update this as soon as possible. |
Hey @rodolfobandeira, sorry to make you wait. Could you please test airbrake-ruby v4.5.1 and airbrake v9.4.0? There are some performance improvements which should reflect what you see on the graph. I also strongly recommend to update your Airbrake config to log to This way it'll be easy to pinpoint issues with Airbrake. This is useful because previously we would log just to where By the way, I am not closing this issue just yet because we want to make sure that the problem is gone. There may be more performance improvements that we have to make and I would greatly appreciate your help here. |
@kyrylo I was running with that versions (airbrake-ruby v4.5.1 and airbrake v9.4.0) with performance stats enabled and I noticed that the responses were slow, after rolling back to an old version (5.5.0), the response time came back to normal. |
Thanks for testing @brunozrk. Could you specify what you consider slow and what difference we're talking about? |
Likely fixes: * airbrake/airbrake#994 (Memory usage) * airbrake/airbrake#990 (CPU and Average Response increased after version 7) The SQL query collection feature is still in alpha and we display it only for certain accounts. Therefore, the vast majority of our customers cannot even see what airbrake-ruby collects. Since the feature is still in alpha, it is currently buggy (in a sense that it consumes too much memory & CPU power). I profiled a Rails app on a certain route with `memory_profiler` for Rack Mini Profiler and I can see a significant increase of memory usage. === performance_stats = false ``` Total allocated: 12434583 bytes (145711 objects) Total retained: 508023 bytes (3346 objects) allocated memory by gem 264 airbrake/lib ``` === performance_stats = true && query_stats = false ``` Total allocated: 12461685 bytes (146002 objects) Total retained: 508431 bytes (3353 objects) allocated memory by gem 3816 airbrake/lib ``` === performance_stats = true && query_stats = true ``` Total allocated: 186535107 bytes (1447037 objects) Total retained: 35810972 bytes (349882 objects) allocated memory by gem 709720 airbrake/lib ``` According to these reports memory usage ramped up by 700% compared to the route stats feature. The route stats feature itself is already quite expensive and the query collection feature is just too much.
Likely fixes: * airbrake/airbrake#994 (Memory usage) * airbrake/airbrake#990 (CPU and Average Response increased after version 7) The SQL query collection feature is still in alpha and we display it only for certain accounts. Therefore, the vast majority of our customers cannot even see what airbrake-ruby collects. Since the feature is still in alpha, it is currently buggy (in a sense that it consumes too much memory & CPU power). I profiled a Rails app on a certain route with `memory_profiler` for Rack Mini Profiler and I can see a significant increase of memory usage. === performance_stats = false ``` Total allocated: 12434583 bytes (145711 objects) Total retained: 508023 bytes (3346 objects) allocated memory by gem 264 airbrake/lib ``` === performance_stats = true && query_stats = false ``` Total allocated: 12461685 bytes (146002 objects) Total retained: 508431 bytes (3353 objects) allocated memory by gem 3816 airbrake/lib ``` === performance_stats = true && query_stats = true ``` Total allocated: 186535107 bytes (1447037 objects) Total retained: 35810972 bytes (349882 objects) allocated memory by gem 709720 airbrake/lib ``` According to these reports memory usage ramped up by 700% compared to the route stats feature. The route stats feature itself is already quite expensive and the query collection feature is just too much.
Likely fixes: * airbrake/airbrake#994 (Memory usage) * airbrake/airbrake#990 (CPU and Average Response increased after version 7) The SQL query collection feature is still in alpha and we display it only for certain accounts. Therefore, the vast majority of our customers cannot even see what airbrake-ruby collects. Since the feature is still in alpha, it is currently buggy (in a sense that it consumes too much memory & CPU power). I profiled a Rails app on a certain route with `memory_profiler` for Rack Mini Profiler and I can see a significant increase of memory usage. === performance_stats = false ``` Total allocated: 12434583 bytes (145711 objects) Total retained: 508023 bytes (3346 objects) allocated memory by gem 264 airbrake/lib ``` === performance_stats = true && query_stats = false ``` Total allocated: 12461685 bytes (146002 objects) Total retained: 508431 bytes (3353 objects) allocated memory by gem 3816 airbrake/lib ``` === performance_stats = true && query_stats = true ``` Total allocated: 186535107 bytes (1447037 objects) Total retained: 35810972 bytes (349882 objects) allocated memory by gem 709720 airbrake/lib ``` According to these reports memory usage ramped up by 700% compared to the route stats feature. The route stats feature itself is already quite expensive and the query collection feature is just too much.
Likely fixes: * airbrake/airbrake#994 (Memory usage) * airbrake/airbrake#990 (CPU and Average Response increased after version 7) The SQL query collection feature is still in alpha and we display it only for certain accounts. Therefore, the vast majority of our customers cannot even see what airbrake-ruby collects. Since the feature is still in alpha, it is currently buggy (in a sense that it consumes too much memory & CPU power). I profiled a Rails app on a certain route with `memory_profiler` for Rack Mini Profiler and I can see a significant increase of memory usage. === performance_stats = false ``` Total allocated: 12434583 bytes (145711 objects) Total retained: 508023 bytes (3346 objects) allocated memory by gem 264 airbrake/lib ``` === performance_stats = true && query_stats = false ``` Total allocated: 12461685 bytes (146002 objects) Total retained: 508431 bytes (3353 objects) allocated memory by gem 3816 airbrake/lib ``` === performance_stats = true && query_stats = true ``` Total allocated: 186535107 bytes (1447037 objects) Total retained: 35810972 bytes (349882 objects) allocated memory by gem 709720 airbrake/lib ``` According to these reports memory usage ramped up by 700% compared to the route stats feature. The route stats feature itself is already quite expensive and the query collection feature is just too much.
Likely fixes: * #994 (Memory usage) * #990 (Add support for Rails engine route prefixes) More details in airbrake/airbrake-ruby#495. In short, this disables SQL query collection by default and allows enabling it only for certain accounts.
Likely fixes: * #994 (Memory usage) * #990 (Add support for Rails engine route prefixes) More details in airbrake/airbrake-ruby#495. In short, this disables SQL query collection by default and allows enabling it only for certain accounts.
I released v9.4.1 with a fix. Could you guys take a look? The issue was that we accidentally run SQL query collection for your accounts as an alpha feature but you cannot even test see it because it's still in the works. I believe v9.4.1 fixes your issues but I want to double check. Thanks a lot for your input and screenshots, it was a great help. |
I'm closing this because I believe this is resolved but I still welcome any feedback of yours. |
Hi @kyrylo I decided to try again upgrading the Airbrake gem. Today, deployed the latest version 10 instead of 8 like I did when this issue was created. This is what happened: Here are the more details:
My main concern is that Airbrake would deprecate the version 7 at some point. We're also seeing a warning when we access the Airbrake portal saying we're running an outdated library version. Do you have any recommendation? @brunozrk how's the situation over there? Any luck? |
Hey @rodolfobandeira, on your screenshot it started spiking before your code was deployed (if I understood the screenshot correctly): Do you have an explanation for this? Do you guys run APM? You could try to disable it, deploy and see the effect: Airbrake.configure do |c|
c.performance_stats = false
end If that detects an issue, you can flip the switch back to Airbrake.configure do |c|
c.query_stats = false
end Airbrake.configure do |c|
c.job_stats = false
end I would really appreciate if you could test that. That will give me an idea where to look. P.S. So far you are the only one who reported about this issue (and @brunozrk) :) |
Hi @kyrylo The short spikes around ~75 ms and is comon in our application here. And as you can see, most of the big short spikes are related with database (yellow) mainly. Our deplyment process runs many different steps so the vertical line you can see doesn't represent the exact minute the servers switched to the new config. It might shift by few minutes. The clear pattern for us is the avg line moving from ~75ms to 150ms only when the Airbrake > 7 gem is present. Here is another screenshot with what happened before, during and after: As you could see, the latency is definitely around the ruby block. I'll try to get more info. I can't try this week though because we'll have some holidays here in Canada. I'll get back to you by next week. Also, I'm not sure if you get any more details from your backend, but our account with Airbrake is: Thanks again, |
Thanks for the update! Just a heads up, this is a public repo, you may edit out your account name. |
@rodolfobandeira unfortunately I didn't try an update after that event. And now im not able to test (I have just changed my job). Sorry |
Gentle ping @rodolfobandeira |
I'm sorry we've been really busy here and we can't test this again in production once I already did and shared results here 3 times. Keep in mind that your gem > version 7 is the issue to us here and was also identified for other user. This for me is a flag that there is a big issue affecting all your clients. Putting an effort to understand what is going on will help everyone. For us, is unacceptable to have a 2x increase in latency if we just upgrade Airbrake's gem. Unfortunately, if we loose support for the version 7, we'll need to find another alternative. |
You can upgrade and set Airbrake.configure do |c|
c.query_stats = false
end This will give me a clue as to where to look for the problem. |
Looks like more people came here complaining about the same issue. Although, for some people just disabling
performance_stats
and upgrading from version 8 to 9 solved the issue.Unfortunately, for us here, changing that config and versions didn't help. It only came back to the regular ~130 ms after rolling back the gem to
version 7
. The average response for the webservers increased from~130ms
to~260ms
. Doesn't look that our database was affected. All stats looks the same.Please let us know what would be your recommendation otherwise we'll have to stay on version 7 forever. Thank you! 😕
More details:
Rails 5.1
andRuby 2.4
:New Relic Average Response:
Web Servers CPU Usage:
After rolling back to version 7
First upgrade, avg response from
~130ms
to~260ms
:Gemfile
Gemfile.lock
Second upgrade. Still
~260ms
avg responseGemfile:
Gemfile.lock
Third change, avg response still
~260ms
Airbrake and Airbrake ruby same of previous step.
Last change. Back to
~130ms
avg response:Gemfile
Gemfile.lock
The text was updated successfully, but these errors were encountered: