Skip to content

Commit

Permalink
Add an option to configure celery workers size. (#2085)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkyryliuk authored Feb 3, 2017
1 parent 543c22b commit a6e0f1b
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 a6e0f1b

Please sign in to comment.