問題描述
這是完整的錯(cuò)誤:SqlException:從服務(wù)器接收結(jié)果時(shí)發(fā)生傳輸級(jí)錯(cuò)誤.(提供程序:共享內(nèi)存提供程序,錯(cuò)誤:1 - 在讀/寫操作中檢測到?? I/O 錯(cuò)誤)
對于我的應(yīng)用程序中的一些單元測試(有超過 1100 個(gè)單元和系統(tǒng)測試),我開始間歇性地看到此消息.我正在使用 ReSharper 4.1 中的測試運(yùn)行程序.
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.
另外一件事:我的開發(fā)機(jī)器是 VMWare 虛擬機(jī).
One other thing: my development machine is a VMWare virtual machine.
推薦答案
我很久以前就遇到過這個(gè)問題.最重要的是,您的可用端口已用完.
I ran into this many moons ago. Bottom line is you are running out of available ports.
首先確保您的調(diào)用應(yīng)用程序啟用了連接池.
First make sure your calling application has connection pooling on.
如果是,則檢查 SQL Server 的可用端口數(shù).
If that does then check the number of available ports for the SQL Server.
發(fā)生的情況是,如果池關(guān)閉,則每個(gè)調(diào)用都會(huì)占用一個(gè)端口,默認(rèn)情況下需要 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 的所有端口并確保您有足夠的端口并在必要時(shí)擴(kuò)展它們.
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.
當(dāng)我遇到此錯(cuò)誤時(shí),連接池已關(guān)閉,只要在網(wǎng)站上放置了適當(dāng)?shù)呢?fù)載,就會(huì)導(dǎo)致此問題.我們沒有在開發(fā)中看到它,因?yàn)樨?fù)載最多為 2 或 3 人,但是一旦人數(shù)超過 10,我們就會(huì)不斷看到此錯(cuò)誤.我們開啟了池化,并修復(fù)了它.
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.
這篇關(guān)于導(dǎo)致此 SqlException 的原因:從服務(wù)器接收結(jié)果時(shí)發(fā)生傳輸級(jí)錯(cuò)誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!