old_contents: from __future__ import print_function
  
  import json
  import multiprocessing
  import os
  
  workers_per_core_str = os.getenv("WORKERS_PER_CORE", "2")
  web_concurrency_str = os.getenv("WEB_CONCURRENCY", None)
  host = os.getenv("HOST", "0.0.0.0")
  port = os.getenv("PORT", "80")
  bind_env = os.getenv("BIND", None)
  use_loglevel = os.getenv("LOG_LEVEL", "info")
  if bind_env:
      use_bind = bind_env
  else:
      use_bind = "{host}:{port}".format(host=host, port=port)
  
  cores = multiprocessing.cpu_count()
  workers_per_core = float(workers_per_core_str)
  default_web_concurrency = workers_per_core * cores
  if web_concurrency_str:
      web_concurrency = int(web_concurrency_str)
      assert web_concurrency > 0
  else:
      web_concurrency = int(default_web_concurrency)
  
  # Gunicorn config variables
  loglevel = use_loglevel
  workers = web_concurrency
  bind = use_bind
  keepalive = 120
  
  errorlog = "-"
  accesslog = "-"
  capture_output = True
  enable_stdio_inheritance = True
  
  # disable limit request line till 414 issue is resolved
  limit_request_line = 0
  limit_request_field_size = 0
  
  
  # For debugging and testing
  log_data = {
      "loglevel": loglevel,
      "workers": workers,
      "bind": bind,
      # Additional, non-gunicorn variables
      "workers_per_core": workers_per_core,
      "host": host,
      "port": port,
  }
  print(json.dumps(log_data), flush=True)
  
new_contents: from __future__ import print_function
  
  import json
  import multiprocessing
  import os
  
  workers_per_core_str = os.getenv("WORKERS_PER_CORE", "2")
  web_concurrency_str = os.getenv("WEB_CONCURRENCY", None)
  host = os.getenv("HOST", "0.0.0.0")
  port = os.getenv("PORT", "80")
  bind_env = os.getenv("BIND", None)
  use_loglevel = os.getenv("LOG_LEVEL", "info")
  if bind_env:
      use_bind = bind_env
  else:
      use_bind = "{host}:{port}".format(host=host, port=port)
  
  cores = multiprocessing.cpu_count()
  workers_per_core = float(workers_per_core_str)
  default_web_concurrency = workers_per_core * cores
  if web_concurrency_str:
      web_concurrency = int(web_concurrency_str)
      assert web_concurrency > 0
  else:
      web_concurrency = int(default_web_concurrency)
  
  # Gunicorn config variables
  loglevel = use_loglevel
  workers = web_concurrency
  bind = use_bind
  keepalive = 120
  timeout = 300
  
  errorlog = "-"
  accesslog = "-"
  capture_output = True
  enable_stdio_inheritance = True
  
  # disable limit request line till 414 issue is resolved
  limit_request_line = 0
  limit_request_field_size = 0
  
  
  # For debugging and testing
  log_data = {
      "loglevel": loglevel,
      "workers": workers,
      "bind": bind,
      # Additional, non-gunicorn variables
      "workers_per_core": workers_per_core,
      "host": host,
      "port": port,
  }
  print(json.dumps(log_data), flush=True)
  
subject: Increase gunicorn timeout