Connection pool issue.

37 views
Skip to first unread message

Freddy González

unread,
Oct 31, 2023, 1:03:13 PM10/31/23
to firebird-net-provider
I'm having a "connection pool is full" issue when my application receive many requests and many connections to my database are open. Basically, this is happening because I have a maxPool = 100; in FbConnectionStringBuilder and I'm having more than 100 connections at the same time. However, I'm also setting connectionTimeout = 5, so I'm expecting that if there is no free connection in the pool, it would wait 5 seconds for a connection to be free, in case that no connection is free in 5 seconds then the exception is thrown.

What's the best way to achive this? I'm using asp .net 6 and FirebirdSql.EntityFrameworkCore.Firebird version 9.1.1.

Thank you in advance for your help.
Freddy

Jiří Činčura

unread,
Oct 31, 2023, 1:09:51 PM10/31/23
to 'Mr. John' via firebird-net-provider
The "Connection Timeout" is for opening connection/socket only. It's not used for pool waiting.

You can obviously retry, but if you *really* have that many connections opened for a ***valid reason***, I would rather increase the pool size. It's not like Firebird can't handle i.e. 200 connections.

--
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/
> --
> You received this message because you are subscribed to the Google
> Groups "firebird-net-provider" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to firebird-net-pro...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/firebird-net-provider/9fb55b7c-f9be-4dd7-be41-6530dc31f15cn%40googlegroups.com
> <https://groups.google.com/d/msgid/firebird-net-provider/9fb55b7c-f9be-4dd7-be41-6530dc31f15cn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Freddy González

unread,
Nov 2, 2023, 6:22:41 AM11/2/23
to firebird-net-provider
Thank you for your answer =)

I understand, the problem is that there could be more than 1000 devices and they all are configured at the same time with a custom tool, all of them will open the request to my server at the same time. Right now, I'm controlling the dbcontexts. I'm not sure if this is the best way to solve this problem, but I have a context factory and if a dbcontext is required, it will wait until less than 100 dbcontexts are in used.

Thank you very much for your help anyway, If you have any other better way to solve this issue. I would be thankful, if you share it =).

Jiří Činčura

unread,
Nov 2, 2023, 10:49:38 AM11/2/23
to 'Mr. John' via firebird-net-provider
> I understand, the problem is that there could be more than 1000 devices
> and they all are configured at the same time with a custom tool, all of
> them will open the request to my server at the same time. Right now,
> I'm controlling the dbcontexts. I'm not sure if this is the best way to
> solve this problem, but I have a context factory and if a dbcontext is
> required, it will wait until less than 100 dbcontexts are in used.
>
> Thank you very much for your help anyway, If you have any other better
> way to solve this issue. I would be thankful, if you share it =).

This smells like it could use some form of message queuing (and background workers).
Reply all
Reply to author
Forward
0 new messages