Slow performance due to per query latency connecting to database?

That smells… swappy. AR does a lot of memory work to convert data between formats, and if you’re a bit tight on memory, it could end up touching lots of pages that need to be swapped in.