I have a Rails app backed by an Azure-managed Postgres database and I use NewRelic for monitoring. What I've noticed is that the INSERT performance degrades almost linearly over time - what started off as about 7ms became about 150ms average over a few weeks.
I then restarted the DB server and the INSERT was back to about 7ms.
What are some of the things that could cause this that I can look into? The table is pretty small at only 250k rows but it's at a pretty constant load which I expect to increase in future making these restarts impossible without impacting the customers.