导致此 SqlException 的原因:从服务器接收结果时发

What causes this SqlException: A transport-level error has occurred when receiving results from the server(导致此 SqlException 的原因:从服务器接收结果时发生传输级错误)
本文介绍了导致此 SqlException 的原因:从服务器接收结果时发生传输级错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是完整的错误:SqlException:从服务器接收结果时发生传输级错误.(提供程序:共享内存提供程序,错误:1 - 在读/写操作中检测到​​ I/O 错误)

对于我的应用程序中的一些单元测试(有超过 1100 个单元和系统测试),我开始间歇性地看到此消息.我正在使用 ReSharper 4.1 中的测试运行程序.

I've started seeing this message intermittently for a few of the unit tests in my application (there are over 1100 unit & system tests). I'm using the test runner in ReSharper 4.1.

另外一件事:我的开发机器是 VMWare 虚拟机.

One other thing: my development machine is a VMWare virtual machine.

推荐答案

我很久以前就遇到过这个问题.最重要的是,您的可用端口已用完.

I ran into this many moons ago. Bottom line is you are running out of available ports.

首先确保您的调用应用程序启用了连接池.

First make sure your calling application has connection pooling on.

如果是,则检查 SQL Server 的可用端口数.

If that does then check the number of available ports for the SQL Server.

发生的情况是,如果池关闭,则每个调用都会占用一个端口,默认情况下需要 4 分钟使端口过期,而您的端口即将用完.

What is happening is that if pooling is off then every call takes a port and it takes by default 4 minutes to have the port expire, and you are running out of ports.

如果启用了池,那么您需要分析 SQL Server 的所有端口并确保您有足够的端口并在必要时扩展它们.

If pooling is on then you need to profile all the ports of SQL Server and make sure you have enough and expand them if necessary.

当我遇到此错误时,连接池已关闭,只要在网站上放置了适当的负载,就会导致此问题.我们没有在开发中看到它,因为负载最多为 2 或 3 人,但是一旦人数超过 10,我们就会不断看到此错误.我们开启了池化,并修复了它.

When I came across this error, connection pooling was off and it caused this issue whenever a decent load was put on the website. We did not see it in development because the load was 2 or 3 people at max, but once the number grew over 10 we kept seeing this error. We turned pooling on, and it fixed it.

这篇关于导致此 SqlException 的原因:从服务器接收结果时发生传输级错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)