Bug 1089967 - It takes a very long time to run 'bundle install' in ruby-1.8 app compare with ruby-1.9
Summary: It takes a very long time to run 'bundle install' in ruby-1.8 app compare wit...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Scott Dodson
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1171747
TreeView+ depends on / blocked
 
Reported: 2014-04-22 10:02 UTC by Ma xiaoqiang
Modified: 2016-07-04 00:44 UTC (History)
5 users (show)

Fixed In Version: rubygem-bundler-1.3.5-3.el6op rubygem-net-http-persistent-2.3.2-3.el6op rubygem-thor-0.18.1-1.el6op
Doc Type: Bug Fix
Doc Text:
Cause: Ruby Bundler for ruby18 applications was out of date and had compatibility issues with rubygems.org. Consequence: ruby18 applications that used bundle install would take prohibitively long to deploy. Fix: Ruby Bundler has been updated. Result: bundle install completes in a timely manner.
Clone Of:
: 1171747 (view as bug list)
Environment:
Last Closed: 2015-01-08 15:34:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0019 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.3 bug fix and enhancement update 2015-01-08 20:33:24 UTC

Description Ma xiaoqiang 2014-04-22 10:02:12 UTC
Description of problem:
It takes a very long time to run 'bundle install' in ruby-1.8 app compare with ruby-1.9 app, this will cause gem dependency install take too much time when git push for ruby-1.8 app.

Version-Release number of selected component (if applicable):
puddle[2.1/2014-04-17.2]



How reproducible:
always

Steps to Reproduce:
1.create a ruby-1.8 app
#rhc app create rb18 ruby-1.8 
2.login the app and run 'bundle install'
>cd ruby
>cat >Gemfile <<EOF
source 'https://rubygems.org'
gem 'ref'
gem 'rack'
EOF
>time bundle install


Actual results:
OutPut:
Fetching source index for https://rubygems.org/
Installing rack (1.5.2) 
Installing ref (1.0.5) 
Using bundler (1.0.21) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
real    11m38.648s
user    3m19.057s
sys     0m14.684s

Expected results:
It should only take a short time

Additional info:
Do the same operations in ruby-1.9 app
Output:
Fetching gem metadata from https://rubygems.org/..........
Installing rack (1.5.2) 
Installing ref (1.0.5) 
Using bundler (1.1.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
real    0m6.367s
user    0m1.608s
sys     0m0.146s

If I call ruby193 bundle in ruby-1.8 app, login the ruby-1.8 app, run the following commads
#export LD_LIBRARY_PATH=/opt/rh/ruby193/root/usr/lib64
#time /opt/rh/ruby193/root/usr/bin/bundle install
Output:
<--snip-->
real    0m6.690s
user    0m1.751s
sys     0m0.162s
It will take a very short time to install the dependencies.

Comment 2 Luke Meyer 2014-04-22 14:21:06 UTC
Completely untested theory here - it seems likely to me the difference is in the availability of gems from the local install. Bundler will just use system-installed gems if they match the Gemfile specification, or download them from rubygems.org otherwise; obviously the latter path is slower. Ruby 1.8 gems are no longer needed as part of the node install, while 1.9 gems are, so that could be part of the difference. Also the change to not install *all* cartridge dependencies by default could be a factor.

If I'm right, a workaround could be to install all the available gem RPMs (or at least the ones of most concern). That will only help if the Gemfile matches, of course. A more representative test might be the difference in building a Rails quickstart.

Comment 4 Scott Dodson 2014-12-04 20:07:34 UTC
There seems to have been some changes to the rubygems.org APIs around the March timeframe that results in horrible performance using extremely old versions of rubygem-bundler.

If I update to rubygem-bundler-1.3.5 using RPMs packaged for OpenShift Online the problem goes away. This would match versions with ruby193-rubygem-bundler as well.

[rb18-test.example.com ruby]\> time bundle install
Fetching gem metadata from https://rubygems.org/..........
Installing rack (1.5.2) 
Installing ref (1.0.5) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

real	0m14.306s
user	0m6.324s
sys	0m0.770s


There appear to have been a number of subsequent enhancements to bundler performance even since 1.3.5 but I think using the same version that OpenShift Online uses and that is shipped in RHSCL is less risky than going to the latest version.

If we use Online's packaging we'll need to update rubygem-thor and rubygem-net-http-persistent too, I'm not sure how much of a risk that is.

The versions I've tested with thus far :
rubygem-bundler-1.3.5-3.el6oso.noarch.rpm
rubygem-net-http-persistent-2.3.2-3.el6oso.noarch.rpm
rubygem-thor-0.18.1-1.el6oso.noarch.rpm

Comment 5 Brenton Leanhardt 2014-12-04 20:21:20 UTC
Updating those packages should be fine.  The only other ruby-1.8 code we have is rhc.

Comment 10 Ma xiaoqiang 2014-12-08 04:46:22 UTC
Check on puddle [2.2.z/2014-12-05.1]

>time bundle install 
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Installing rack (1.5.2) 
Installing ref (1.0.5) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

real	0m10.398s
user	0m3.652s
sys	0m0.574s

Comment 12 errata-xmlrpc 2015-01-08 15:34:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0019.html


Note You need to log in before you can comment on or make changes to this bug.