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.
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.
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
Updating those packages should be fine. The only other ruby-1.8 code we have is rhc.
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
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