2

I noticed ruby processes (60!) eating up ram on my server... I saw most of them were spring processes which I did not want. See this:

$ ps aux | grep spring 
david    30704  0.0  0.0   7832   836 pts/4    S+   21:02   0:00 grep spring

$ rails c -e production
Loading production environment (Rails 4.1.6)
irb(main):001:0> exit

$ ps aux | grep spring 
david    30798  6.1  0.6 156640 25976 pts/4    Sl   21:02   0:00 spring server | 49 | started 5 secs ago                             
david    30802 46.4  2.6 256888 108364 ?       Ssl  21:02   0:02 spring app    | 49 | started 5 secs ago | development mode                                                              
david    30814  0.0  0.0   7832   836 pts/4    S+   21:02   0:00 grep spring

$ cat Gemfile | grep spring -C 5
group :development do
  gem 'better_errors'
  gem 'meta_request'
  gem 'awesome_print'
  gem 'binding_of_caller'
  gem 'spring'
end

gem 'twilio-ruby'
gem "highcharts-rails", "~> 4.0.0"
gem 'whenever'
$ 

So why are they popping up? If I remove gem 'spring' from Gemfile altogether, this stops... so why is Rails starting the spring server in production console if the gem is in the development group?

Baldrick
  • 23,882
  • 6
  • 74
  • 79
davidhq
  • 4,660
  • 6
  • 30
  • 40
  • well, that's probably a problem with how you spawn your production process. so my question to you, how are you running your application on the server? – phoet Jan 25 '15 at 19:02
  • `puma -C puma.rb` but that probably doesn't matter because `spring` comes up when trying to get into console (`rails c -e production`).. so even if puma is not running (that's independet) – davidhq Jan 26 '15 at 12:41
  • so the problem starts when you are launching the rails console? did you try to unspring your binaries? https://github.com/rails/spring#removal – phoet Jan 26 '15 at 12:56
  • I didn't know about that, thank you... so is it normal for spring to get started even in production console? Because if I unspring the binaries, then spring will not run in development and I want that.. I want the same code in dev and prod. It's strange that spring runs in production in the first place... :/ – davidhq Jan 26 '15 at 17:50
  • you can use an [environment variable to disable it](https://github.com/rails/spring#temporarily-disabling-spring) temporarily and no, i think it should not be launched in production even with those binstubs. i assume that there is something wrong in your configuration as i havn't seen that behavior before. – phoet Jan 27 '15 at 13:52

0 Answers0