问题标签 [connection-timeout]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
869 浏览

sql-server - 连接超时

我的方法执行大量异步 SQL 请求,并且我不断收到连接超时异常。除了增加连接超时值和正确索引之外,我还能做什么?我的意思是数据库部分,而不是代码部分。无法更改代码部分。此外,该应用程序在不同的服务器上运行良好,但只有我在我的电脑和本地 MS SQL Server 2008 R2 数据库(也在同一台电脑上)上遇到了这些超时异常。所以我认为这显然是一个性能问题,因为连接超时已经设置为 3 分钟。也许我可以在服务器上更改一些东西?也许有许多同时请求限制?我的每个请求显然需要不到 3 分钟,但其中大约有 26 000 个异步运行,只有我在本地 PC 和本地数据库上遇到这些问题。我运行了进程监视器,我看到在我的代码启动时,SQL Server 最终消耗了 200 MB 的 RAM,并占用了大约一半的 CPU 处理时间。但是我还有 1 GB 的可用 RAM,所以这不是内存问题。

0 投票
5 回答
18940 浏览

sql-server - 多线程 Windows 服务中的多个同时 SQL 连接超时

我有一个使用 VS 2010 (.NET 4.0) 开发的多线程 Windows 服务,它可以有几个到几十个线程,每个线程都通过 Internet 从慢速服务器检索数据,然后使用本地数据库记录这个数据(因此该进程是 Internet 绑定的,而不是 LAN 或 CPU 绑定的)。

有规律地,我同时从多个线程中收到以下错误的洪水/混乱/突发:

System.Data.SqlClient.SqlException (0x80131904):超时已过期。在操作完成之前超时时间已过或服务器没有响应。

此错误的调​​用堆栈通常为:

在 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory)

在 System.Data.SqlClient.SqlConnection.Open()

我没有在连接字符串中指定连接超时,并且还有其他应用程序和进程在此数据库中工作。有没有人遇到过这种行为,如果有,有什么措施可以防止这种行为?

我的数据访问层中最常用的方法是这样的,我所有的其他 DAL 方法都遵循相同的方法:

非常感谢!

编辑

鉴于有关在镜像环境中发生这种情况的评论,我确实应该提到有问题的数据库是镜像的。它在 SSMS 中标记为“主体,同步”,处于“无自动故障转移(同步)的高安全性”模式。

编辑 2011 年 5 月 26 日

我在 SQL Server 日志中没有看到任何问题。(我无权访问该服务器上的 Windows 事件查看器,但我已要求有人来找我。)

0 投票
1 回答
377 浏览

jquery - Ajax post, repsonse not received

Currently I am doing a jQuery post to fetch some data from the server. In standard circumstances a large JSON is returned.

The first time this call runs it requires a large amount of processing time, (I've seen up to 15 minutes. We do have plans to create worker processes to build these behind the scenes and relay progress to the client) after the processing has completed we store this in a cache and return the JSON to the user.

In both scenarios we return exactly the same JSON to the client, the only difference being, if the cache is built it is returned in a few milliseconds, if the cache is not built, it can take a long time for the client to receive the response.

When this is running on the server, if the requests takes a long time the client never receives the ajax response but the server does complete the process (access logs show 200 statusCode) and store the cache. For reference on my localhost the ajax response is always received, regardless of time (or so I have seen thus far).

In a nutshell, we make a ajax post, if it takes a long time, the post response is never received and ends up waiting indefinitely.

This sounds like it is either a PHP or server side setting, but I can't seem to find the issue.

Any ideas or help are much appreciated.

0 投票
5 回答
78374 浏览

rest - SoapUI:ConnectException:连接超时:

我尝试通过 REST 发送请求。使用 firefox rest-client 时,我得到了成功响应,但在 SoapUI 中,我在下面附加了异常。如何解决这个问题?谢谢。

java.net.ConnectException:连接超时:在 java.net.PlainSocketImpl.doConnect(Unknown Source) 在 java.net.PlainSocketImpl.connectToAddress(Unknown Source) 在 java.net.PlainSocketImpl.socketConnect(Native Method) 处连接。 net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net。 Socket.(Unknown Source) at java.net.Socket.(Unknown Source) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory org.apache.commons.httpclient.HttpConnection 上的 .createSocket(DefaultProtocolSocketFactory.java:122)。在 org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector. java:387) 在 org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) 在 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) 在 com.eviware.soapui.impl .wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:202) at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123) at java.util.concurrent.Executors$RunnableAdapter .call(Unknown Source) at java.util.concurrent.FutureTask$Sync。innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source ) 在 java.lang.Thread.run(Unknown Source)

0 投票
4 回答
14769 浏览

android - HttpClient 执行不断给出 ConnectTimeoutException

我的应用程序中有一个非常大的错误,我似乎真的无法解决。每当我通过以下代码拨打休息电话时:

我在 DDMS 中得到错误:

但有时代码运行完美,我收到了我应该收到的数据。我还通过计算机上的普通网络浏览器测试了其余服务器调用,它总是在 100 毫秒内返回我的数据。那么我做错了什么?我还在另一台设备上对其进行了测试,但这给了我同样的问题。如果有人能解决我的问题,我会很高兴:)

0 投票
3 回答
29097 浏览

sql-server - 超时已过。操作完成前超时时间已过或服务器无响应

嗨,我遇到了一个错误Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
我已经更改了连接timeout = 60000,并且在数据库中我的程序在 43 秒内执行。所以请给我一些完美的解决方案

谢谢你

0 投票
3 回答
1939 浏览

asp.net - 一分钟后网站连接超时 - ASP.NET

我最近发布了我的 asp.net 网页,在离开页面后,页面处于非活动状态并且没有焦点似乎大约一分钟,当您尝试按下页面上的任何内容(按钮、链接等)时,连接将超时。为了解决这个问题,我必须刷新页面并继续执行任何尝试执行的按钮/功能。

会话超时当前设置为 100 分钟,我不知道为什么会发生这种情况。如果有帮助的话,我的网站是使用带有 .net v4.0(.30319) 的 VS 2010 ult 构建的。不确定我可以提供哪些其他相关信息,因为我不知道是什么原因造成的。

非常感谢,彼得

0 投票
0 回答
5061 浏览

asp.net - “bin dir 更改或目录重命名”应用重启的原因?(固定我认为)

更新/修复

好吧,我做了两件事似乎可以奏效

  1. 将我的应用程序池的高级设置>>进程模型>>身份更改为“网络服务”
  2. 指示它使用临时文件夹在站点 .net 编译设置上进行编译。仍然每隔一段时间重新启动一次,但会话不会丢失,所有浏览器仍然可以连接。

这也有效:http ://www.aaronblake.co.uk/blog/2009/09/28/bug-fix-application-restarts-on-directory-delete-in-asp-net/

我正在 asp.net 4 中构建我的网络应用程序,并且很难弄清楚为什么我的连接在大约一分钟后超时(当浏览到 - 使用 IIS 7 托管时)。我被告知这可能是由于正在编辑 web.config/目录,因此应用程序被卸载/重新启动并且页面消失了。我不知道我编写的任何代码都明确地编辑了 bin 上的任何内容。

我正在连接到 sql(通过表适配器或 SQLConnection 类),但我认为这不会做任何事情。我也使用作为脚本运行的按钮。

我已在 IIS 中将重新启动配置更改选项设置为 false 仍然无济于事..

编辑

以下是关闭的一些事件日志。

我一直在思考为什么 bin 会被改变。完全不知所措,我们写的任何东西都没有写任何东西/故意改变任何东西

0 投票
3 回答
1976 浏览

asp.net - SQL 连接超时

我们在我们的一个网站上一直面临着奇怪的连接超时。

我们的环境由一个 IIS 7 Web 服务器(在 Windows Server 2008 R2 标准版上运行)和一个 SQL Server 2008 数据库服务器组成。

在调试引起超时的网站功能时,我们注意到连接本身需要几毫秒才能完成,但是SqlCommand调用数据库上的存储过程的连接在执行过程中会挂起几分钟,然后引发超时异常。

另一方面,当我们直接在数据库上运行存储过程时,只需 2 秒即可正确完成执行。

我们已经尝试了以下方法:

  • 修改SqlCommand网站代码超时
  • web.config修改文件的执行超时
  • 修改文件sessionState超时web.config
  • 修改web.config文件上的授权 cookie 超时
  • 修改了 IIS 上网站属性的连接超时
  • 修改了 IIS 上的应用程序池关闭时间限制
  • 检查 IIS 上的应用程序池空闲超时
  • 检查 SQL Server 属性的执行超时(设置为 0,无限制)
  • 使用其他参数直接在数据库上测试存储过程

我们感谢任何帮助。

尼拉夫

0 投票
4 回答
89818 浏览

ajax - ajax 请求后浏览器会等待多长时间?

在服务器响应请求之前,浏览器可以等待多长时间才能显示错误?这个时间可以无限吗?