Closed Bug 1408592 Opened 8 years ago Closed 8 years ago

Avoid running out of RDS connections

Categories

(Socorro :: Symbols, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peterbe, Assigned: peterbe)

Details

Attachments

(1 file)

With RDS the amount of connections you can create is limited [0]. See https://sentry.prod.mozaws.net/operations/symbols-stage/issues/666658/ We can either with to persistent connections [1] or we can try to send a connection into each future when using a ThreadPoolExecutor pool. [0] https://stackoverflow.com/a/38555806/205832 [1] https://devcenter.heroku.com/articles/python-concurrency-and-database-connections#persistent-connections and https://docs.djangoproject.com/en/1.11/ref/databases/#persistent-connections
I can't find any way to supply a custom connection or cursor to the ORM. Probably best to use persistent connections.
Another option worth considering is to not do any saves inside the upload_file_upload() function. Instead it could be made to return FileUpload *instances* and then in the archive_upload() view call FileUpload.bulk_create(file_uploads).
Assignee: nobody → peterbe
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: