github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/controller/templates/gconf.py (about)

     1  bind = '0.0.0.0'
     2  try:
     3      workers = int({{ if exists "/deis/controller/workers" }}{{ getv "/deis/controller/workers" }}{{ else }}"not set"{{end}})
     4      if workers < 1:
     5          raise ValueError()
     6  except (NameError, ValueError):
     7      import multiprocessing
     8      try:
     9          workers = multiprocessing.cpu_count() * 2 + 1
    10      except NotImplementedError:
    11          workers = 8
    12  proc_name = 'deis-controller'
    13  timeout = 1200
    14  pidfile = '/tmp/gunicorn.pid'
    15  loglevel = 'info'
    16  errorlog = '-'
    17  accesslog = '-'
    18  access_log_format = '%(h)s "%(r)s" %(s)s %(b)s "%(a)s"'
    19  
    20  
    21  def worker_int(worker):
    22      """Print a stack trace when a worker receives a SIGINT or SIGQUIT signal."""
    23      worker.log.warning('worker terminated')
    24      import traceback
    25      traceback.print_stack()
    26  
    27  
    28  def worker_abort(worker):
    29      """Print a stack trace when a worker receives a SIGABRT signal, generally on timeout."""
    30      worker.log.warning('worker aborted')
    31      import traceback
    32      traceback.print_stack()