How many instances of Netlify Functions are running?

I’m running the website and every now and then we get a spike of simultaneous connections to our DB. This sometimes happens several times a day. This reaches the maximum number of connections allowed by our DB and breaks the website for a while.
Since each of our lambda functions only keeps one connection open, there shouldn’t be more connections that the number of instances of our functions that are running.

Is there any way of knowing how many instances of a lambda function are running simultaneously?

Hi @PabloRomanH , can you confirm if you’re seeing this behavior on a specific path of your site, or during a specific time range? In order to check our logs, we’ll need to narrow it down a bit so if you can provide any additional details about when/where this is happening, we can investigate a bit further!

Everything is pointing to the database taking longer to answer than usual and that causing the problems.
I was just hoping to be able to know how many instances of each endpoint were running to help with debugging.

There is no way for you to find that number, but as Amelia has offered, if you’d like provide more details we can research in our internal access logs. I do need to set expectations: we don’t have a good view for “how many things are running concurrently”, though; we record each access separately and there is no easy way for me to graph what’s running at the same time. But, the requests are logged with a start time and a duration, so what I will offer is to export those logs for a minute’s worth of your traffic so you can do the math :). But you have to help me identify the one minute where an event happened, so I can find it in our logs to export the right thing.

What we need to know is:

  • what time(s) you saw the problem at, fairly precisely
  • please include date + timezone

Then we’ll be able to look back in time - up to 30 days - to find your details and export so you can answer your own question :slight_smile: