NeonN
Neon2y ago
21 replies
urgent-maroon

Lots of "SSL connection has been closed unexpectedly" errors

Hey there, we're using Neon as a DB for a control plane for batch processing jobs. We're on the Launch plan. Execution of batch processes have multiple k8s workers connecting to the DB to report the status of their job runs. This ends up creating a lot of concurrent connections. We've recently been seeing this error
qlalchemy.exc.OperationalError: (psycopg2.OperationalError) SSL connection has been closed unexpectedly
[SQL: UPDATE block_run SET updated_at=now(), status=%(status)s, completed_at=%(completed_at)s WHERE block_run.id = %(block_run_id)s]
[parameters: {'status': 'COMPLETED', 'completed_at': datetime.datetime(2024, 5, 16, 19, 12, 57, 459853, tzinfo=<UTC>), 'block_run_id': 32907}]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

and it's been happening a lot. We don't know if it's because we're triggering some kind of abuse protection system or getting rate limited in some way but by all the docs I've read we're well within the limits. Monitoring says that the most concurrent connections we've ever had is 103 which is under the need for scaling above 0.25 vCPU but we did try scaling up to a min of 1 vCPU to see if that would improve and the results were inconclusive. Could we get some help on this?
Was this page helpful?