Skip to content

Commit a6e0f1b

Browse files
authoredFeb 3, 2017
Add an option to configure celery workers size. (#2085)
1 parent 543c22b commit a6e0f1b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

‎superset/cli.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ def refresh_druid(datasource, merge):
144144
session.commit()
145145

146146

147-
@manager.command
148-
def worker():
147+
@manager.option(
148+
'-w', '--workers', default=config.get("SUPERSET_CELERY_WORKERS", 32),
149+
help="Number of celery server workers to fire up")
150+
def worker(workers):
149151
"""Starts a Superset worker for async SQL query execution."""
150152
# celery -A tasks worker --loglevel=info
151153
print("Starting SQL Celery worker.")
@@ -159,5 +161,6 @@ def worker():
159161
'broker': config.get('CELERY_CONFIG').BROKER_URL,
160162
'loglevel': 'INFO',
161163
'traceback': True,
164+
'concurrency': int(workers),
162165
}
163166
c_worker.run(**options)

‎superset/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
ROW_LIMIT = 50000
3333
VIZ_ROW_LIMIT = 10000
3434
SUPERSET_WORKERS = 2
35+
SUPERSET_CELERY_WORKERS = 32
3536

3637
SUPERSET_WEBSERVER_ADDRESS = '0.0.0.0'
3738
SUPERSET_WEBSERVER_PORT = 8088

0 commit comments

Comments
 (0)
Please sign in to comment.