title: What's the performance impact of disabling eager_load in production.rb?
body: <p>My rails 4.1 app connects to a second, non-primary server via SSH for a backend jobs. Consequently, when the rails app restarts daily, the SSH connection needs to be live/up (rather the second, non-primary server needs to live/up), otherwise the the app crashes. This is due to eager loading by default being set to true in <code>production.rb</code> (<code>config.eager_load = true</code>). </p>
  
  <p>I'm tempted to break this dependency by disabling eager loads, but I'm not able to find much information on the performance impact. So, my questions are... </p>
  
  <p>1) if <code>eager_load</code> is set to <code>false</code>, will that simple slow down the app's startup time, or will the app eagerly load resources the first time they are hit? </p>
  
  <p>3) If <code>eager_load</code> is simply turned off, to what degree will this impact the performance off the app (more subjective question)? </p>
  
  <p>2) The model that performs the SSH connection are under folder <code>app\models\legacy</code>. Instead of changing <code>eager_load</code> to false, can that folder be excluded from eager loaded resources? If so, how? I believe I would need to edit <code>config.autoload_paths += Dir[Rails.root.join('app', 'models', '{**/}')]</code> but not entirely sure. </p>
  
  <p><strong>production.rb:</strong></p>
  
  <pre><code>  # Eager load code on boot. This eager loads most of Rails and
    # your application in memory, allowing both thread web servers
    # and those relying on copy on write to perform better.
    # Rake tasks automatically ignore this option for performance.
    config.eager_load = true
  </code></pre>