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

Performance degradation in Rails App with 9.0.4 (Compared to 1.7.23) #3594

Closed
ylansegal opened this issue Jan 12, 2016 · 1 comment
Closed

Comments

@ylansegal
Copy link

I'm working on upgrading a Rails 4.2 application from jruby-1.7.23 to jruby-9.0.4.0. This is a fairly large app, running on trinidad and using MySQL and MongoDB.

I am opening this ticket as suggested by @headius on IRC (Thanks to @Enobo too for helping out).

The first indication of performance issues is our specs take way longer. On 1.7.23 it takes 17:55, on 9.0.4.0 it takes 41:15. Over 4K specs running.

Our unmodified code, running locally on trinidad and hitting a single endpoint (it's a pretty slow one to start with, that involves quite a bit of database activity). The benchmark was conducted with siege, twice on each version (for warmup):

$ siege -c 4 -t30s $URL

For 1.7.23:

Transactions:                 59 hits
Availability:             100.00 %
Elapsed time:              29.05 secs
Data transferred:           0.27 MB
Response time:              1.38 secs
Transaction rate:           2.03 trans/sec
Throughput:             0.01 MB/sec
Concurrency:                2.79
Successful transactions:          59
Failed transactions:               0
Longest transaction:            1.92
Shortest transaction:           0.46

For 9.0.4.0

Transactions:                 45 hits
Availability:             100.00 %
Elapsed time:              29.08 secs
Data transferred:           0.20 MB
Response time:              1.96 secs
Transaction rate:           1.55 trans/sec
Throughput:             0.01 MB/sec
Concurrency:                3.03
Successful transactions:          45
Failed transactions:               0
Longest transaction:            3.32
Shortest transaction:           0.60

As you can see the response time is 42% slower.

If I modify the code so that the controller does nothing (except for before_filters and auth token validation) and returns head :ok, then the performance is quite similar (9.0.4.0 is 6% slower). This would indicate that there is something inside our code.

As suggested by @headius, I tried runnig the same benchmark with profiling in --sample mode. You can see the results for both 1.7.23 and 9.0.4.0 in this gist. I would appreciate some help reading the output: I can't tell from that where I should focus my attention on.

I also profiled the inside of the controller action in 9.0.4.0, but I can't see an obvious bottleneck either. The results are in the same gist.

I appreciate guidance and direction to get to the bottom of this.

Thanks,

@kares kares added this to the Invalid or Duplicate milestone Jan 12, 2016
@kares kares closed this as completed Jan 12, 2016
@donv
Copy link
Member

donv commented Jan 12, 2016

Duplicate of #3595 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants