Closed sjmf closed 2 years ago
Although the Celery log doesn't confirm it, I suspect that the issue arises with the Django bulk_update
method called in BulkConnectionManager.
Testing shows that Django generates a very large UPDATE
with CASE WHEN
statements.
I have decreased the DATABASE_CHUNK_SIZE
variable to 1000, tested successfully on the development instance, and committed the change in e606554.
Further testing is required for the optimal DATABASE_CHUNK_SIZE
per #92. Closing this issue for now as resolved, however, we should monitor the production database for such errors and consider increasing the work_mem
setting in Postgres.
The connection to the database sometimes fails when running the flood model, with the exception
django.db.utils.OperationalError: connection to server at "postgres" (172.28.0.4), port 5432 failed: FATAL: the database system is in recovery mode
.Viewing the stack traces, the
postgres
process is killed with signal 9 (SIGKILL).I believe this is likely to be an Out of Memory error in Postgres.
Postgres Stack Trace:
Celery Stack Trace: