Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Use redis as backend for celery. Also re-enable autoscale (#22)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Co <alex.tuan@mindvalley.com>
  • Loading branch information
onimsha authored Apr 23, 2024
1 parent b4cca06 commit eecc10d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions backend/danswer/background/celery/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
logger = setup_logger()

connection_string = build_connection_string(db_api=SYNC_DB_API)
# celery_broker_url = f"sqla+{connection_string}"
celery_broker_url = "redis://redis-server-service:6379/0"
celery_backend_url = f"db+{connection_string}"
celery_backend_url = "redis://redis-server-service:6379/0"
celery_app = Celery(__name__, broker=celery_broker_url, backend=celery_backend_url)


Expand Down
2 changes: 1 addition & 1 deletion backend/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ autorestart=true
# relatively compute-light (e.g. they tend to just make a bunch of requests to
# Vespa / Postgres)
[program:celery_worker]
command=celery -A danswer.background.celery worker --pool=threads --loglevel=DEBUG --logfile=/var/log/celery_worker.log
command=celery -A danswer.background.celery worker --pool=threads --autoscale=10,3 --loglevel=DEBUG --logfile=/var/log/celery_worker.log
stdout_logfile=/var/log/celery_worker_supervisor.log
stdout_logfile_maxbytes=52428800
redirect_stderr=true
Expand Down

0 comments on commit eecc10d

Please sign in to comment.