title: What does Early termination of worker puma log mean and why is it happening?
body: <p>For my Elastic Beanstalk instance, I am getting a <code>504</code> status code response whenever I visit it. When I tail the logs I see the following log on the puma app server:</p>
  
  <pre><code>==&gt; /var/log/puma/puma.log &lt;==
  [27240] Early termination of worker
  [27245] Early termination of worker
  [27249] Early termination of worker
  [27253] Early termination of worker
  [27257] Early termination of worker
  [27261] Early termination of worker
  [27265] Early termination of worker
  [27269] Early termination of worker
  [27273] Early termination of worker
  [27277] Early termination of worker
  </code></pre>
  
  <p>What does <code>Early termination of worker</code> mean and why is it happening? Moreover, could the log be indicating the cause of my timeout error I am facing in my remote environment? The rails app and puma run perfectly on my local machine (Mac OS Catalina 10.15). However, in my remote Elastic beanstalk environment as stated above I am getting a timeout 504 error and the only thing I see in the logs is the above puma log. </p>
  
  <p>This is my gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '~&gt; 6.0.1'
  # Use mysql as the database for Active Record
  gem 'mysql2', '&gt;= 0.4.4'
  # Use Puma as the app server
  gem 'puma', '~&gt; 4.1'
  # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
  gem 'webpacker', '~&gt; 4.0'
  # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
  gem 'turbolinks', '~&gt; 5'
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  gem 'jbuilder', '~&gt; 2.7'
  # Use haml view syntax
  gem 'haml-rails'
  
  # the main komponent gem is broken for Rails 6, see:
  # https://github.com/komposable/komponent/issues/133
  gem 'komponent', github: '0x2C6/komponent'
  gem 'elasticsearch', '~&gt; 6.2'
  gem 'redis'
  
  # Use Active Model has_secure_password
  # gem 'bcrypt', '~&gt; 3.1.7'
  
  # Use Active Storage variant
  # gem 'image_processing', '~&gt; 1.2'
  
  # Reduces boot times through caching; required in config/boot.rb
  gem 'bootsnap', '&gt;= 1.4.2', require: false
  
  group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
    gem 'pry-rails'
    gem 'rspec-rails', '~&gt; 3.9'
    gem 'dotenv-rails'
    gem 'awesome_print'
  end
  
  group :beta, :production do
    gem 'puma_worker_killer'
  end
  
  group :development do
    # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
    gem 'web-console', '&gt;= 3.3.0'
    gem 'listen', '&gt;= 3.0.5', '&lt; 3.2'
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring'
    gem 'spring-watcher-listen', '~&gt; 2.0.0'
    gem 'spring-commands-rspec'
     # Avoid polling for changes (Windows)
    gem 'wdm', '&gt;= 0.1.0', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  end
  
  group :test do
    gem 'webmock'
  end
  
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>