RNAcentral/rnacentral-sequence-search

Monitor SQL connections

carlosribas opened this issue · 3 comments

I tried to recreate the database, but I got this message: "psycopg2.OperationalError: FATAL: remaining connection slots are reserved for non-replication superuser connections".

I need to review the configuration and check the right way to configure SQLAlchemy to get a good performance and close the connections properly.

Reopened because this issue has not been fully resolved...

For the record
Debugging the problem, I noticed that sometimes the same job_chunk is called twice and this ends up creating a new connection. Log message of the problem:

DEBUG:root:called by create_consumer_scheduler function
DEBUG:root:Queuing JobChunk to consumer: url = http://192.168.0.14:8000/submit-job, json_data = {"job_id": "b4912c06-1a71-4944-b50c-5130fc9e9dd5", "sequence": "CUAUACAAUCUACUGUCUUUC", "database": "all-except-rrna.part_001.fasta"}, headers = {'content-type': 'application/json'}, consumer_ip = 192.168.0.14
DEBUG:root:called by submit_job function
DEBUG:root:Queuing JobChunk to consumer: url = http://192.168.0.15:8000/submit-job, json_data = {"job_id": "b4912c06-1a71-4944-b50c-5130fc9e9dd5", "sequence": "CUAUACAAUCUACUGUCUUUC", "database": "all-except-rrna.part_001.fasta"}, headers = {'content-type': 'application/json'}, consumer_ip = 192.168.0.15