My current setup is a single replica application on Gigalixir talking to a custom Google CloudSQL postgres instance (since I have free credits to use).
Google say there are 25 connections for my instance size, but 6 are “reserved”, so I set ecto to use 19 connections. Everything goes great until I try and deploy. There will be two instances of the app running for about 30 seconds and during this period the newer of the two keeps failing with connection errors. Only when the old one gets terminated does everything go back to normal.
The only solution I have found at the moment is to set my connection pool to 9. This makes the rolling deploys smooth, but just feels a little wasteful.
Any tips on how this has been solved elsewhere?
Thanks for reading!