【发布时间】:2019-10-29 10:54:08
【问题描述】:
我正在尝试使用 Postgres 在 C# API 上设置 Hangfire(版本 1.7.3),但我需要限制 Hangfire 在 Postgres 中使用的连接数。
app.UseHangfireServer(config => {
config.UseServer(2); //that option does't exist for postgres
});
【问题讨论】:
-
那么你的问题是什么?您可以按照您描述的方式限制hangfire并发。有什么问题?
-
您使用哪个版本的 Hangfire.Postgres?上一个版本修复了连接泄漏问题。
-
Hanfire 版本是 1.7.3,Postgres 版本是 11.5。我正在使用 postgres 在数字海洋上运行 API,但它们将 postgres 数据库池限制为 22 个,而 Hangfire 使用几乎所有连接池,大约 18 个池连接。
-
@LucasClazerPerussolo .Net 连接默认是池化的。您可以在池中设置最大和最小空闲连接数。
标签: c# postgresql hangfire