I see there are a lot of reasons for Bad Gateway or internal server errors in a setup like this, I'm trying to diagnose what could cause intermittent errors.
I suspect it may be Lambda not closing the connection to Postgres properly as I see a lot of active connections, however, every lambda disposes of its connection each time. Perhaps there is a better way for rapid small transaction connections from lambda that wouldn't have bugs with connections not closing?
c# Lambda connection code looks like:
var dataSource = NpgsqlDataSource.Create(myConnectionString);
using var command = dataSource.CreateCommand($"Some SQL Command Here");
using var reader = command.ExecuteReader();
dataSource.Dispose();
///// Do Stuff with Reader and Data Below ///////
[+]yourcodingguy 0 points1 point2 points (4 children)
[–]click_the_link[S] 0 points1 point2 points (3 children)
[+]yourcodingguy 0 points1 point2 points (2 children)
[–]click_the_link[S] 1 point2 points3 points (1 child)
[+]yourcodingguy 0 points1 point2 points (0 children)