gpt4 book ai didi

sql-server - Akka .NET 连接池超时问题

转载 作者:行者123 更新时间:2023-12-02 11:19:16 28 4
gpt4 key购买 nike

我们正在使用 Akka.NET 创建一个新系统,并有一个带有分片和持久性的基本集群设置。

我们使用官方文档和一些 Petabridge 博客文章来让分片正常工作。但是,我们遇到了一个问题,即分片超出了 SQL Server 连接池允许的最大连接数。因此,我们收到以下消息...

2017-04-20 14:04:31.433 +01:00 [Warning] "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."



我们相信当分片更新分片日志时会发生这种情况。

为什么分片模块不能正确管理其 SQL 连接?这里有配置问题吗?

发生这种错误时是否可以重试?就目前而言,我们会丢失此错误的每个实例的消息。

这是相关的HOCON
cluster.sharding {
journal-plugin-id = "akka.persistence.journal.sharding"
snapshot-plugin-id = "akka.persistence.snapshot-store.sharding"
}
persistence {
journal {
plugin = "akka.persistence.journal.sql-server"
sql-server {
class = "Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer"
connection-string = "Server=.;Database=akkasystem;Integrated Security=true"
schema-name = dbo
auto-initialize = on
}
# a separate config used by cluster sharding only
sharding {
connection-string = "Server=.;Database=akkasystem;Integrated Security=true"
auto-initialize = on
plugin-dispatcher = "akka.actor.default-dispatcher"
class = "Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer"
connection-timeout = 30s
schema-name = dbo
table-name = ShardingJournal
timestamp-provider = "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
metadata-table-name = ShardingMetadata
}
}
snapshot-store {
sharding {
class = "Akka.Persistence.SqlServer.Snapshot.SqlServerSnapshotStore, Akka.Persistence.SqlServer"
plugin-dispatcher = "akka.actor.default-dispatcher"
connection-string = "Server=.;Database=akkasystem;Integrated Security=true"
connection-timeout = 30s
schema-name = dbo
table-name = ShardingSnapshotStore
auto-initialize = on
}
}
}

最佳答案

这可能表明 SQL 日志被大量传入事件淹没,连接超时触发,而事件正在等待池中的下一个连接被释放。

从您的配置中我怀疑,如果您开始持久化事件并创建高比率的分片/实体,这可能会发生。现有的 SQL 日志将在不久的将来获得显着的速度提升(参见 batching journals)。希望这可以帮助解决您的问题。

关于sql-server - Akka .NET 连接池超时问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43521235/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com