By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

IIS hangs the first time two requests are made for same page quick

P: n/a
It appears that IIS hangs the first time two requests are made for same page
in quick succession. Although it may very well be something else I'm doing
wrong.

I have a page (ViewDocument.aspx) that dynamically generates one or more
image tags. The source attribute of the image tag is another page
(ViewImage.aspx) that simply writes the image data to the response.

When I load ViewDocument.aspx for the first time, everything is fine as long
as it only generates one image tag. I can load it again, generating multiple
image tags, and everything is solid.

However if when I load ViewDocument.aspx the first time, and cause it to
generate multiple image tags, IIS hangs (actually needs to be restarted).

When the error occurs, I see that the ViewImage.aspx constructor is called
twice, but that the Page_Load is never called.

Is it possible that the first request is causing the ViewImage.aspx page to
be compiled and if the second request for that page comes before it's
finished being compiled that the whole thing goes off into the weeds?

Thanks,
Brad

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
HTTP requests usually work in that you don't get a response until you
get a response... meaning that if I send a request to IIS for a page,
IIS makes me wait until it is done processing the page. I wait for
compilation to complete before I get a response.

If I have another request that happens simulatneously, it waits in a
queue until a response can be given.
Do you use a file stream to open an image file? If you do, that may be
where the problem is, depending on which value of the FileShare
enumeration you use. You open the file, which locks the file, and it
won't be released until the stream is closed... which if not done in
code, is done when the garbage collector annihilates the page.

Brad Quinn wrote:
It appears that IIS hangs the first time two requests are made for same page
in quick succession. Although it may very well be something else I'm doing
wrong.

I have a page (ViewDocument.aspx) that dynamically generates one or more
image tags. The source attribute of the image tag is another page
(ViewImage.aspx) that simply writes the image data to the response.

When I load ViewDocument.aspx for the first time, everything is fine as long
as it only generates one image tag. I can load it again, generating multiple
image tags, and everything is solid.

However if when I load ViewDocument.aspx the first time, and cause it to
generate multiple image tags, IIS hangs (actually needs to be restarted).

When the error occurs, I see that the ViewImage.aspx constructor is called
twice, but that the Page_Load is never called.

Is it possible that the first request is causing the ViewImage.aspx page to
be compiled and if the second request for that page comes before it's
finished being compiled that the whole thing goes off into the weeds?

Thanks,
Brad

Nov 18 '05 #2

P: n/a
Thanks Mike, you got me pointed in the right direction.

It turned out that the page I was deriving from implements IHttpAsyncHandler
and uses a custom thread pool (actually I think it's based on Mike
Woodring's).

Telling the page to process synchronously was enough to fix the problem (but
makes me wonder where else I might have problems).

Thanks again,
Brad

"Mike Newton" wrote:
HTTP requests usually work in that you don't get a response until you
get a response... meaning that if I send a request to IIS for a page,
IIS makes me wait until it is done processing the page. I wait for
compilation to complete before I get a response.

If I have another request that happens simulatneously, it waits in a
queue until a response can be given.
Do you use a file stream to open an image file? If you do, that may be
where the problem is, depending on which value of the FileShare
enumeration you use. You open the file, which locks the file, and it
won't be released until the stream is closed... which if not done in
code, is done when the garbage collector annihilates the page.

Brad Quinn wrote:
It appears that IIS hangs the first time two requests are made for same page
in quick succession. Although it may very well be something else I'm doing
wrong.

I have a page (ViewDocument.aspx) that dynamically generates one or more
image tags. The source attribute of the image tag is another page
(ViewImage.aspx) that simply writes the image data to the response.

When I load ViewDocument.aspx for the first time, everything is fine as long
as it only generates one image tag. I can load it again, generating multiple
image tags, and everything is solid.

However if when I load ViewDocument.aspx the first time, and cause it to
generate multiple image tags, IIS hangs (actually needs to be restarted).

When the error occurs, I see that the ViewImage.aspx constructor is called
twice, but that the Page_Load is never called.

Is it possible that the first request is causing the ViewImage.aspx page to
be compiled and if the second request for that page comes before it's
finished being compiled that the whole thing goes off into the weeds?

Thanks,
Brad

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.