连接超时
我的方法执行大量异步 SQL 请求,并且不断收到连接超时异常。除了增加连接超时值和适当的索引之外,我还能做什么?我的意思是数据库部分,而不是代码部分。无法更改代码部分。此外,该应用程序在不同的服务器上运行良好,但只有我在我的电脑和本地 MS SQL Server 2008 R2 数据库(也在同一台电脑上)上遇到这些超时异常。所以我认为这显然是一个性能问题,因为连接超时已经设置为 3 分钟。也许我可以在服务器上更改一些内容?也许有多个同时请求的限制?我的每个请求显然需要不到 3 分钟,但其中大约有 26 000 个请求异步运行,并且只有我在本地 PC 和本地数据库上遇到这些问题。 我运行了进程监视器,发现当我的代码启动时,SQL Server 最终消耗了 200 MB 的 RAM,并占用了大约一半的 CPU 处理时间。但我还有 1 GB 空闲 RAM,所以这不是内存问题。
My method executes lots of asynchronous SQL requests and I constantly get connection timeout exceptions. What else can I do except increasing the connection timeout value and proper indexing? I mean with the database part, not with the code part. Can't change the code part. Besides, the application is running fine on different servers, but only I experience those timeout exceptions on my pc and local MS SQL Server 2008 R2 database (which is also on the same PC). So I think this is clearly a performance issue since the connection timeout is already set to 3 minutes. Maybe there is something I can change on the server? Maybe there is a number of simultanious requests constraint? Each of my requests needs clearly less that 3 minutes, but there are about 26 000 of them running asynchroniously, and only I experience those problems on my local PC and local DB.
I've run the process monitor and I see that at the time when my code starts the SQL Server eventually consumes 200 MB of RAM and takes up about a half of CPU processing time. But I still have 1 GB of RAM free, so this is not a memory problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为连接数可能是原因。确保正确关闭连接或尝试减少连接数量。您还可以使用管道,这将克服通常连接的限制。
I think the number of connection can be the cause. Make sure you close the connection properly or try to reduce the amount of them. You can also use pipes, which will overcome the limitations of usual connections.