title: Rails Server Extremely Slow in Development
body: <p>I've got a rails 5 application that is very slow after I boot the server or change a .rb file. Below is my cli output after I booted the server with <code>rails server</code> and loaded a simple page. Also, if I change a model, controller or helper, the server takes about the same time to respond to the next request. After the request is loaded, the pages load normally but that first request after each change can take 30 seconds which adds up quite fast. I have tried setting the following configs in `development (similar questions suggested these changes). Also, I have this development server running on a digital ocean droplet with 4GB of memory. </p>
  
  <pre><code>config.assets.debug = false
  config.assets.digest = false
  </code></pre>
  
  <p>My output:</p>
  
  <pre><code>rails server
  =&gt; Booting Puma
  =&gt; Rails 5.2.2 application starting in development
  =&gt; Run rails server -h for more startup options
  Puma starting in single mode...
  * Version 3.12.0 (ruby 2.5.3-p105), codename: Llamas in Pajamas
  * Min threads: 5, max threads: 5
  * Environment: development
  * Listening on tcp://0.0.0.0:3000
  Use Ctrl-C to stop
  Started GET "/treadmill-parts-model-select" for 98.251.169.224 at 2019-04-03 
  11:51:29 +0000
  Cannot render console from 98.251.169.224! Allowed networks: 127.0.0.1, ::1, 
  127.0.0.0/127.255.255.255
  (2.1ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, 
  ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  
  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
  ↳ /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord- 
  5.2.2/lib/active_record/log_subscriber.rb:98
  (2.4ms)  SELECT 'schema_migrations'.'version' FROM 'schema_migrations' ORDER 
  BY 'schema_migrations'.'version' ASC
  ↳ /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord- 
  5.2.2/lib/active_record/log_subscriber.rb:98
  Processing by SearchController#treadmill_model_search as HTML
    Rendering search/treadmill_model_search.html.erb within layouts/application
    Product Load (113.8ms)  SELECT DISTINCT 'products'.'brand' FROM 'products' WHERE 'products'.'product_type' = 'Treadmill' ORDER BY 'products'.'brand' ASC
    ↳ app/views/search/treadmill_model_search.html.erb:22
    Rendered search/treadmill_model_search.html.erb within layouts/application (167.6ms)
    Rendered layouts/_header.html.erb (5.8ms)
    Rendered layouts/_flash_messages.html.erb (1.1ms)
    Rendered layouts/_footer.html.erb (0.5ms)
  Completed 200 OK in 18746ms (Views: 18565.0ms | ActiveRecord: 124.7ms)`
  </code></pre>