Skip to content

Commit

Permalink
Add an option to configure celery workers size. (apache#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkyryliuk authored and Saleh Hindi committed Jun 9, 2017
1 parent 477c12e commit e6bded8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions superset/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ def refresh_druid(datasource, merge):
session.commit()


@manager.command
def worker():
@manager.option(
'-w', '--workers', default=config.get("SUPERSET_CELERY_WORKERS", 32),
help="Number of celery server workers to fire up")
def worker(workers):
"""Starts a Superset worker for async SQL query execution."""
# celery -A tasks worker --loglevel=info
print("Starting SQL Celery worker.")
Expand All @@ -159,5 +161,6 @@ def worker():
'broker': config.get('CELERY_CONFIG').BROKER_URL,
'loglevel': 'INFO',
'traceback': True,
'concurrency': int(workers),
}
c_worker.run(**options)
1 change: 1 addition & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
ROW_LIMIT = 50000
VIZ_ROW_LIMIT = 10000
SUPERSET_WORKERS = 2
SUPERSET_CELERY_WORKERS = 32

SUPERSET_WEBSERVER_ADDRESS = '0.0.0.0'
SUPERSET_WEBSERVER_PORT = 8088
Expand Down

0 comments on commit e6bded8

Please sign in to comment.