很慢首次调用Web服务 [英] Very slow first call to web service

查看:156
本文介绍了很慢首次调用Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序使用Visual Studio 2010,消耗了WebSphere z / OS的暴露web服务写在C#.NET 3.5。 Web应用程序在Windows Server 2008的64位/ IIS 7托管到WS第一次调用花费155000毫秒执行,但服务于不到一秒钟的反应(验证服务器)。到WS的后续调用需要大约45毫秒。在运行时间长,工作进程消耗所有的CPU和分配超过2GB的内存多。当它成为响应内存分配下拉到250 MB和后续调用拿,正如我所说,约45毫秒。这种行为不会发生我的工作站(的Windows 7 64位)上的服务器wtih的Windows Server 2003 32位和IIS 6我也试图生成没有影响串行器/解串器上。任何想法?

I have a web application written in C# .NET 3.5 using Visual Studio 2010 that consumes a web service exposed by Websphere for z/OS. The web application is hosted on Windows Server 2008 64bit/IIS 7. The first call to the WS takes 155000 ms to execute, but the service responded in less than one second (verified on server). The subsequent calls to the WS takes about 45 ms. During the long running time, the worker process consumes all cpu and allocates more than 2Gb of memory. When it becomes responsive the memory allocated drop down to 250 Mb and subsequent calls take, as I said, about 45 ms. This behaviour doesn't happen on my workstation (Windows 7 64 bit) and on a server wtih Windows Server 2003 32 bit and IIS 6. I also tried to generate the serializers/deserializers with no effect. Any ideas?

推荐答案

在很长一段时间,我发现这是关系到64位环境问题,微软知道这个问题。我从微软的解决方案没有任何反应。经过长时间的搜寻后,我发现这篇文章<一个href=\"http://stackoverflow.com/questions/4137335/xmlserializer-startup-huge-performance-loss-on-64bit-systems\">XmlSerializer在64位系统启动巨大的性能损失,说这个参数添加到web.config中:

After a long time, I discovered that this is a problem related to 64bit environment and Microsoft knows the problem. I had no response from Microsoft for a solution. After a long search I found this article XmlSerializer startup HUGE performance loss on 64bit systems that says to add this parameter to the web.config:

<configuration>
  <system.diagnostics>
    <switches>
      <add name="XmlSerialization.Compilation" value="4"/>
    </switches>
  </system.diagnostics>
</configuration>

我测试了这个解决方案和反序列化SOAP流所花费的时间已经下降到2秒。没有那么糟糕。缺点是临时目录得到由临时文件淹没。
现在的问题是:为什么启用此开关时滴下来?
还有一些其他的开关,我可以尝试没有保留临时文件?

I tested this solution and the time taken to deserialize the soap stream has dropped to 2 seconds. Not so bad. The drawback is that the temp directory gets flooded by temporary files. Now the question is: why enabling this switch the time drops down? There is some other switch I can try without keeping the temp files?

这篇关于很慢首次调用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆