Open zhongqingshen opened 3 years ago
HI, I have the same, not solved yet but I found interesting information.
According to internet info looks like it's necessary to increase the sql pool connections, but I hope HangFire team can share us their point of view @odinserj .
If you are on a dedicated server and simply need more SQL connections, you may update the "max pool size" entries in both connection strings by following these instructions:
Log into your server using Remote Desktop.
Open My Computer (Windows - E) and go to C:\inetpub\vhosts\[domain]\httpdocs
Double click on the web.config file. This may just be listed as web if the file structure is set to hide extensions. This will open up Visual Basic or similar editor.
Find your Connection Strings, these will look similar to the examples below:
<add name="SiteSqlServer" connectionString="server=(local);database=dbname;uid=dbuser;pwd=dbpassword;pooling=true;connection lifetime=120;max pool size=25;" />
<add key="SiteSqlServer" value="server=(local);database=dbname;uid=dbuser;pwd=dbpassword;pooling=true;connection lifetime=120;max pool size=25;" />
Change the max pool size=X value to the required pool size.
Save and close your web.config file.
Same issue, we have a long running system and after about 7 days of automated testing it happens. How come the pools continually grow and never cleaned up?
.AddHangfireServer(options =>
{
options.WorkerCount = 1;
});
Could setting the worker count to 1 fix the "all pooled connections in use" error?
ERROR Message:
I have modified the Hangfire source code. The database password will be changed from time to time, so the project needs to dynamically obtain the database password. change code as below:
When adding doWork to a project, this is done every 2 minutes. A connection pooling error occurs after 5 hours. Do not know where is not releasing the connection, please help me