Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to configure celery workers size. #2085

Merged
merged 2 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -31,6 +31,7 @@

ROW_LIMIT = 50000
SUPERSET_WORKERS = 2
SUPERSET_CELERY_WORKERS = 32

SUPERSET_WEBSERVER_ADDRESS = '0.0.0.0'
SUPERSET_WEBSERVER_PORT = 8088
Expand Down