3

I have my site hosted on IIS hosting. Site has feature that needs calling WCF service and then return result. The issue is that site is processing calling to WCF service another web site calling is freezing and not return content fast (this is just static content). I setup two chrome instances with different imacros' scripts, which one is calling page that requests wcf service and another one page is just static content. So here I can just see that when first page that requests wcf services freezes, another one page also freezes and when first is released the second is too.

Do I need reconfigure something in my Web.Config or do should I do something else to get possible to get static content immediately.

kseen
  • 359
  • 8
  • 56
  • 104

5 Answers5

2

I would say that this is a threading issue. This MSDN KB article has some suggestions on how to tune your ASP.NET threading behavior:

http://support.microsoft.com/kb/821268

From article - ...you can tune the following parameters in your Machine.config file to best fit your situation:

  • maxWorkerThreads
  • minWorkerThreads
  • maxIoThreads
  • minFreeThreads
  • minLocalRequestFreeThreads
  • maxconnection
  • executionTimeout

To successfully resolve these problems, do the following:

  • Limit the number of ASP.NET requests that can execute at the same time to approximately 12 per CPU.
  • Permit Web service callbacks to freely use threads in the ThreadPool.
  • Select an appropriate value for the maxconnections parameter. Base your selection on the number of IP addresses and AppDomains that are used.

etc...

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • I'm on shared windows hosting and it seems like I can only tune my own web.config file. Is your approach fits this conditions? – kseen Feb 16 '12 at 16:09
  • I don't think so. You need to change these settings in machine.config. From MSDN (http://msdn.microsoft.com/en-us/library/7w2sway1.aspx): *The processModel section can be set only within the Machine.config file* – tom redfern Feb 16 '12 at 16:13
  • How can I set this 'Permit Web service callbacks to freely use threads in the ThreadPool.' item? Please advice. – kseen Feb 17 '12 at 05:29
2

I think that there are two seperate problems here:

  1. Why does the page that uses the WCF service freeze
  2. Why does the static content page freeze

On the page that calls the WCF service a common problem is that the WCF client is not closed. By default there are 10 WCF connections with a timeout of 1 min. The first 10 calls go fine (say they execute i 2 secs), then the 11th call comes, there are no free wcf connections it must therefore wait 58 secs for a connection to timeout and become available.

On why your static page freezes. It could be that your client only allows one connection to the site, the request for the static page is not sent untill the request for the page with the wcf services is complete.

You should check the IIS logs to see how must time IIS is reporting that the request is taking.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
1

Consider such scenario: when you make a request to IIS your app changes, deletes or creates some file outside of App_Data folder. This often tends to be a log file which is mistakenly was put at bin folder of the app. The file system changes lead to AppDomain reloading by IIS as it thinks that app was changed, hence the experienced delay. This may or may not apply to your issue, but it is a common mistake in ASP.NET apps.

ogggre
  • 2,204
  • 1
  • 23
  • 19
1

Well, maybe there is no problem...

It may be just the browser's same domain simultaneous requests limit.
Until the browser not finished the request to the first page (the WCF page), it won't send the request to the second page (the static).

Try this:
Use different browsers for each page (for example chrome/firefox).
Or open the second page in chrome in incognito window (Ctrl + Shift + N).
Or try to access each page from different computer.

Oleg Grishko
  • 4,132
  • 2
  • 38
  • 52
0

You could try to use AppFabric and see what is wrong with your WCF services http://msdn.microsoft.com/en-us/windowsserver/ee695849

marvelTracker
  • 4,691
  • 3
  • 37
  • 49
  • If I undertand right, AppFabric may help only if WCF service is hosted under IIS? – kseen Feb 22 '12 at 02:57
  • Yes. you are correct. Where is your WCF service is hosted? if it is possible, you could call web service as duplex rather wait for it's response immediately. – marvelTracker Feb 22 '12 at 07:31
  • It's selfhosted WCF service, hosted in console application. Calling duplex isn't so fit as I want. – kseen Feb 22 '12 at 08:15
  • Ok. However, you rely on external party to give data which could be time consuming, may be you could concern on asynchronous programming, though – marvelTracker Feb 22 '12 at 09:27