.net 远程处理每 100 秒停止一次

发布于 2024-07-08 15:56:51 字数 136 浏览 3 评论 0原文

我们遇到了非常奇怪的问题,我们的一个应用程序正在使用 .net 远程处理不断查询服务器,并且每隔 100 秒该应用程序就会停止查询一小段时间,然后恢复操作。 问题出在客户端而不是服务器上,因为应用程序实际上同时查询多个服务器并同时停止从所有服务器接收数据。

We have very strange problem, one of our applications is continually querying server by using .net remoting, and every 100 seconds the application stops querying for a short duration and then resumes the operation. The problem is on a client and not on the server because applications actually queries several servers in the same time and stops receiving data from all of them in the same time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

那片花海 2024-07-15 15:56:51

100 秒是一个赠送的数字,因为它是 .Net 中 Web 请求的默认超时。

我过去曾见过,PSI(Microsoft Project 中的项目服务器接口)不会覆盖超时,因此应用了默认值 100 秒,并且会终止与其通信时间超过该时间的任何内容。

您是否有权访问所有代码,并且确定已在适用的情况下设置了超时,以便不会在您不知情的情况下应用任何默认值?

100 Seconds is a give away number as it's the default timeout for a webrequest in .Net.

I've seen in the past that the PSI (Project Server Interface within Microsoft Project) didn't override the timeout and so the default of 100 seconds was applied and would terminate anything talking to it for longer than that time.

Do you have access to all of the code and are you sure you have set timeouts where applicable so that any defaults are not being applied unbeknownst to you?

临走之时 2024-07-15 15:56:51

我以前从未见过这种行为,不幸的是,这是一个非常模糊的场景,我认为您将很难在这个板上找到遇到该问题的人。 它可能特定于您的应用程序。

我认为您可以进行一些调查来帮助您缩小问题范围。

  1. 确定到底是客户端还是服务器发生了停顿。 如果您在确定这一点时遇到问题,请尝试安装数据包过滤器并监视流量以查看谁发送了最后的数据。 您可能无法读取二进制数据,但至少您会了解谁落后了。
  2. 一旦确定是客户端还是服务器导致了延迟,请尝试调试应用程序并在发生挂起的位置设置断点。 这应该为您提供足够的详细信息来帮助追踪问题。 或者至少问一个关于SO的更明确的问题。

I've never seen that behavior before and unfortunately it's a vague enough scenario I think you're going to have a hard time finding someone on this board who's encountered the problem. It's likely specific to your application.

I think there are a few investigations you can do to help you narrow down the problem.

  1. Determine whether it's the client or server that is actually stalling. If you have problems determining this, try installing a packet filter and monitor the traffic to see who sent the last data. You likely won't be able to read the binary data but at least you will get a sense of who is lagging behind.
  2. Once you figure out whether it's the client or server causing the lag, attempt to debug into the application and get a breakpoint where the hang occurs. This should give you enough details to help track down the problem. Or at least ask a more defined question on SO.
三生路 2024-07-15 15:56:51

应用程序如何编码来实现连续查询? 是连续循环吗? 或者带有 Thread.Sleep 的循环? 或者是在计时器上?,

首先确定您的系统是否在您期望的时间在代码中执行此“触发器”,或者如果是,并且远程服务器没有响应......所以, ...

如果您无法在可以调试的开发环境中重现此问题,那么,如果可以的话,我建议您向此循环添加代码,以便每次都将其写入日志文件(或其他一些持久性机制) “应该”检查它使用的任何条件来决定是否查询远程服务器,然后在问题再次发生时查看这些日志...

如果您可以在远程服务器中执行相同的操作,以记录服务器何时收到远程处理请求,这也会有帮助......

哦,是的,只是一个想法,(我不知道你是如何编码的......)但是如果你在客户端中使用单独的线程来发出远程处理请求,并且通道正在该单独的线程上注册和取消注册,请确保您正在消除请求冲突,因为您无法同时在同一台计算机上注册同一端口两次......
(尽管如果这是问题的话,这可能会在您的客户端中引发异常)

How is the application coded to implement the continuous querying? Is it in a continuous loop? or a loop with a Thread.Sleep? or is it on a timer ?,

It would first be useful to determine if your system is executing this "trigger" in your code when you expect it to, or if it is, and the remoting server is not responding... so, ...

if you cannot reproduce this issue in a development environment where you can debug it, then, if you can, I suggest you add code to this Loop to write out to a log file (or some other persistence mechanism) each time it "should" be examining whatever conditions it uses to decide whether to query the remoting server or not, and then review those logs when the problem reoccurs...

If you can do the same in your remoting server, to record when the server receives a remoting request, this would help as well...

... and oh yes, just a thought, (I don;t know how you have coded this... ) but if you are using a separate thread in client to issue the remoting request, and the channel is being registered, and unregistered on that separate thread, make sure you are deconflicting the requests, cause you can't register the same port twice on the same machine at the same time...
(although this should probably have raised an exception in your client if this was the issue)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文