Need Help with 'Page can not be displayed' form my web service

M

mithu

I have a web service(C#) which involves processing lot of information thru a
third party component. I have couple of issues with my web service.
Issue 1:
My web service calls a third party component. The whole operation including
getting results to the user takes 16 mins. But even after changing the
timeouts to 30 Mins, i was getting time out error just after couple of
minutes. It works only after I changed all the time outs to > 30 Mins. Why do
I need timeouts > than the processing time? who takes precedence?
machine.config or web.config? The timeouts worked only after I changed my
machine.config? Am I wrong in assuming that you an override machine.config
with web.config as long as the value is less than machine.config?
Issue 2:
I get page can not be displayed in my browser just three minutes after
my web service call the third party component(which is a com component). But
I dont see any error in the event log. I added debug statements to trace the
path of execution. Even though I get page can not be displayed, I could see
the process is completed succesfully( I insert debug statement to sql
server...I see all of them)... I tried to make the call to the third party
component,asynchronous one. It still didnt solve my problem.

The sequesce of actions....
web server dumps the input to sql server(which in turn is used by the third
party component)
web server calls app server(where the web service resides)
web service calls the thrid pary component ....(it is a HTTPWebRequest)
..
Waits for response from third party component
--page can not be displayed in couple minutes) ---
( but can see the output dumped to the log table.dont see any error)

I changed memorylimit, maxRequestLength,responseDeadlockInterval as
discussed in so many articles. It didnt help me. It is eating up my time and
brain. I dont really know what the problem is. I am desperate for some help.
Would greatly appreciate any feedback.
 
D

Dan Rogers

Hi Mithu,

I cannot recommend you continue to solve this problem in the way you are
now. In general, I would classify any request/response synchronous method
that takes 16 minutes as a bug in the service design.

Here is my suggestion. Make your request/response a two step process by
associating each request with a unique identifier. Then submit your
requests as you do now, but respond immediately - either with no response,
or by assigning the unique identifier on the server side. Since your
service seems to queue up a request in the database, you can readily
convert this design to a batch that gets kicked off behind the scenes.

Then, add a second method to your service called FetchResults (or something
like this) - this takes the unique identifer assigned previously as an
argument. If the results are not ready yet, this should return a "not
ready" indicator (e.g. an empty data payload with no errors, and perhaps a
message or numeric code that indicates to try later). If the results are
ready, they should be loaded, and then returned - and then possibly
deleted. You will probably want to set a clean-up time on each result to
handle the cases where a calling party fails to wait for the answers -
create a nightly job that deletes all expired result sets.

Now, I'll try to answer some of your original questions, but only for
completeness - as I said, I strongly advise you to redesign your server
since this design will never scale adequately (high volumes).
Issue 1:
My web service calls a third party component. The whole operation including
getting results to the user takes 16 mins. But even after changing the
timeouts to 30 Mins, i was getting time out error just after couple of
minutes. It works only after I changed all the time outs to > 30 Mins. Why do
I need timeouts
There will be several time-outs in place. Time-outs are safety valves
built into COM, into the proxy, and into ASP.net itself. These are
designed to protect the server, not your application, by assuming that the
program has failed in some way that needs to be cleaned up.
than the processing time? who takes precedence?
machine.config or web.config? The timeouts worked only after I changed my
machine.config? Am I wrong in assuming that you an override machine.config
with web.config as long as the value is less than machine.config?

In general, web.config on a local directory takes precedence over
web.config in a root above it. But machine config sets universal policy,
so it is special and should be considered the master. You can add things
into a web.config if they are not in the machine.config and they will take
precedence. But a machine config entry generally represents machine wide
policy - which is a good thing because it lets the administrator decide on
how the machine will be managed. A good rule of thumb is if you have to
mess with machine.config to get your applicaiton to work, you should
consider filing a high-priority, show stopper bug against your application.
Issue 2:
I get page can not be displayed in my browser just three minutes after
my web service call the third party component(which is a com component). But
I dont see any error in the event log. I added debug statements to trace the
path of execution. Even though I get page can not be displayed, I could see
the process is completed succesfully( I insert debug statement to sql
server...I see all of them)... I tried to make the call to the third party
component,asynchronous one. It still didnt solve my problem.

I'm assuming you mean the test page, and not a call from a proxy. In
general, a COM component that doesn't fail will not result in an event log
entry. To the COM component, which apparently is manipulating the way COM
deals with calls that take too long, nothing bad happened - this jives with
your observation that it all worked.

The client-side - whether it is a browser or a ASP.net proxy, has it's own
time out. If you've ever typed in a URL that took way too long to respond,
you get the browsers default "I can't open this page" display. This is
probably what you are seeing. Again, if a test page makes your browser
time out, your design could be considered, at least by some, to be fatally
flawed.


I know this isn't what you wanted to hear (at least this is my guess), but
a good web application will respond in less than a few milliseconds - even
if the response is "wait" - and then use a polling mechanism to get the
final response without tying up a web server thread.

I hope this helps

Dan Rogers
Microsoft Corporation
 
M

mithu

Thanks Dan. I didn't go for submitting and polling because all requests are
smaller except few which varies from 6MB xml to 26 MB(these cases are rare
occurrences) which is actually giving me the problem. Please tell me before
I make a final decision, will making the call to web service asynchronous
help me? Can I tackle it in any other way? The business application does not
want to make two calls to the web services or differentiate the calls based
on the size of the input.

I appreciate your help.
 
D

Dan Rogers

Hi Mithu,

I don't see how making the call a fire-and-forget (e.g. one-way call) will
help you . An async call will require that you either poll from the
client, or message back to the caller when the results are finished. This
is really difficult since most callers do not expose the infrastructure
required to post a message (e.g. a web service, or SOAP reader, or message
queue with a stable endpoint),

A lot of people confuse the non-blocking call ability provided by the proxy
clases with asynchronous behavior. The non-blocking calls (e.g. invoking
the method with BeginMyMethod(), etc) are not async - and do the exact same
work as a blocking call on the wire. In short, if your web methods return
data, you cannot make an async call to them.

If there are a lot of small calls, and just a few very large calls, have
you considered separating these? E.g. call a different method for known
small calls versus known large calls? If it were me, I'd always make the
"large calls" into batch operations that are submitted (preferably not via
HTTP due to the fragile nature of the connections) and then later the
results are picked up when ready.

I hope this helps,

Dan Rogers
Microsoft Corporation

--------------------
 
M

mithu

D

Dan Rogers

It's a matter of terminology.

On the server side, when you make a call with Begin/End pairing from the
proxy, the service itself is in an synchronous (response on same
connection) call. So, from the server/service perspective, if the
code(method) takes too long, it's going to get harvested as a "in trouble"
thread.

I prefer to describe the Begin/End calling approach supported by the
generated proxies as "non-blocking" calls. The client is not doing an
async request (where async means I send it, I don't wait for a response) -
not in the true sense. The begin/end methods simply set up a delegate and
have that delegate make a sync call on a separate thread in the calling
application.

Does this help?

Dan
--------------------
Thread-Topic: Need Help with 'Page can not be displayed' form my web service
thread-index: AcTdSpKTjNwPVuMcTUmORgdiXc23pQ==
X-WBNR-Posting-Host: 12.163.36.130
From: "=?Utf-8?B?bWl0aHU=?=" <[email protected]>
References: <[email protected]>
<[email protected]>
 
M

mithu

Thank you very much Dan. I appreciate all your help. On digging further, I
found out the problem was with the browser. When I increase the timeouts( I
know this is not the best way to do it....We are planning to change it to
implement some other mechanism later), the servers seem fine and waiting for
the response. It is just the browser. The problem got fixed when we increase
the connection timeout in IIS. Thanks a lot again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top