Beispiel #1
0
def stop_workers(signal=signal.SIGTERM):
	''' Stop all workers.

	Parameters
	----------
	signal : optional, default is (signal.SIGTERM)

	'''
	print "stopping workers: %s" % hosts_str
	run("%s multi stop %s -%s --pidfile=%s" % (FabUtil.get_celery_command(), WORKER_NAME, signal, PID_FILE))
Beispiel #2
0
def stop_workers(signal=signal.SIGTERM):
    ''' Stop all workers.

	Parameters
	----------
	signal : optional, default is (signal.SIGTERM)

	'''
    print "stopping workers: %s" % hosts_str
    run("%s multi stop %s -%s --pidfile=%s" %
        (FabUtil.get_celery_command(), WORKER_NAME, signal, PID_FILE))
Beispiel #3
0
def start_workers(concurrency=None, autoscale = False, autoscale_mult = None):
	''' Start workers on registered hosts with specified concurrency.

	Parameters
	----------
	concurrency : int
	autoscale : bool, optional (default is True)
	autoscale_mult : int, optional (default is 2)
		concurrency * autoscale_mult is maximum number of processes.

	See Also
	--------
	http://celery.readthedocs.org/en/latest/reference/celery.bin.multi.html
	'''
	print "starting workers: %s" % hosts_str
	setup_celery_dir()
	with cd(CODE_DIR):
		run("%s multi start %s" % (FabUtil.get_celery_command(), FabUtil.build_celery_opts(concurrency, autoscale=autoscale, autoscale_mult=autoscale_mult)))
Beispiel #4
0
def start_workers(concurrency=None, autoscale=False, autoscale_mult=None):
    ''' Start workers on registered hosts with specified concurrency.

	Parameters
	----------
	concurrency : int
	autoscale : bool, optional (default is True)
	autoscale_mult : int, optional (default is 2)
		concurrency * autoscale_mult is maximum number of processes.

	See Also
	--------
	http://celery.readthedocs.org/en/latest/reference/celery.bin.multi.html
	'''
    print "starting workers: %s" % hosts_str
    setup_celery_dir()
    with cd(CODE_DIR):
        run("%s multi start %s" %
            (FabUtil.get_celery_command(),
             FabUtil.build_celery_opts(concurrency,
                                       autoscale=autoscale,
                                       autoscale_mult=autoscale_mult)))