Too many database connection attempts are curre
Answered
Bracco Italiano posted this in #help-forum
Bracco ItalianoOP
Hey guys, my nextjs app just crashed from this error, this is the first time that has ever happened to me. If anyone could help me out on this i would really appreciate it. This the error i get from the logs. This happened after a QStash callback which calls an endpoint of my app. The QStash callback base url starts with the apps custom domain
Answered by B33fb0n3
when using databases, you first get a connection to your DB and then executed queries via that connections. But when there are too many open connections, there can't be even more and an error is throws. The key point here is "too many connections". So you want to close your connections, after you used them. Either do it inside your code while using something like a "close" function (is always different, depending on what you using) or configure an idle timeout, so your DB closes the connection, that is inactive, after X seconds
6 Replies
@Bracco Italiano Hey guys, my nextjs app just crashed from this error, this is the first time that has ever happened to me. If anyone could help me out on this i would really appreciate it. This the error i get from the logs. This happened after a QStash callback which calls an endpoint of my app. The QStash callback base url starts with the apps custom domain
when using databases, you first get a connection to your DB and then executed queries via that connections. But when there are too many open connections, there can't be even more and an error is throws. The key point here is "too many connections". So you want to close your connections, after you used them. Either do it inside your code while using something like a "close" function (is always different, depending on what you using) or configure an idle timeout, so your DB closes the connection, that is inactive, after X seconds
Answer
@B33fb0n3 when using databases, you first get a connection to your DB and then executed queries via that connections. But when there are too many open connections, there can't be even more and an error is throws. The key point here is "too many connections". So you want to close your connections, after you used them. Either do it inside your code while using something like a "close" function (is always different, depending on what you using) or configure an idle timeout, so your DB closes the connection, that is inactive, after X seconds
Bracco ItalianoOP
Apparently it was an error because of some incident with neon. I'm using vercel integration with neon DB
@Bracco Italiano Apparently it was an error because of some incident with neon. I'm using vercel integration with neon DB
it was an errorso is the issue already solved?
@B33fb0n3 > it was an error
so is the issue already solved?
Bracco ItalianoOP
Yup, all g now, still will look more into concurrent db connections now that this happened
@Bracco Italiano Yup, all g now, still will look more into concurrent db connections now that this happened
Yea, if you want to prevent such described thing, you should do that. Please mark solution[:](https://cdn.discordapp.com/attachments/1043615796787683408/1117191182133501962/image.png?ex=67c0249e&is=67bed31e&hm=01664fa764d85f91e3c18b87a4cfcc8dc17ae4596f0a0950a2d11f68c9a97ff5&)