Altering Edge Config causes surge of MongoDB Atlas Ghost Connections
Unanswered
Temp posted this in #help-forum
TempOP
This is pretty obscure but I am using Vercel pro deployment and we connect to MongoDB atlas via the Node driver using TCP (Yes, this is not the recommended approach by Vercel for serverless functions. But let's ignore that for now). We use a singleton pattern so each lambda/vercel function should only create 1 connection to MongoDB, and it mostly does. For context, we just call the connect to DB at the start of the functions that need it and a connection is created.
However, during deployments OR just when I change the edge config, a lot of ghost connections appear, but ZERO (0) queries/commands? This seems really odd, clearly the functions aren't firing/completing, but we instantly get x10 connections to the DB, and considering the connections only happen from within the functions, it seems to imply Vercel is firing up/warming up the functions causing this issue?
However, during deployments OR just when I change the edge config, a lot of ghost connections appear, but ZERO (0) queries/commands? This seems really odd, clearly the functions aren't firing/completing, but we instantly get x10 connections to the DB, and considering the connections only happen from within the functions, it seems to imply Vercel is firing up/warming up the functions causing this issue?