Server process lifetime

M

Max Metral

I have an application that has a web interface but also provides a direct
TCP interface for some older systems. In IIS5, I used to just spawn a
thread in Application_Start and clean it up when the app ended, and it
seemed to work fine. In IIS6 (winxp pro dev for a target of win2k3
production), it seems to be more aggressive about cleaning up apps and
generally have odd behavior when I spawn threads.

Am I doing something really wrong here? Should I be remoting everything
into a service and just sucking up the performance loss?
 
S

Steven Cheng[MSFT]

Hi Max,

From your description, you're using a background thread in ASP.NET web
application to listening for TCP port? And found that it works well when
you host the web app on machine with IIS5 BUT encounters some strange
behavior on IIS6 WIN2K3,yes?

Since you mentioned that you use a winxp pro dev machine for target win2k3
server, did you found the problem on winxp pro box or the win2k3 product
server? The WINxp pro machine has a limitaion to 10 max tcp connections, so
would you provide some further description on what it does in your separate
background thread in the asp.net app?
Also, what's the detailed info on the strange behavior you encountered, is
there any error info ? Generally, I think it's ok to use a background
thread in asp.net apps if we just do some lightweight tasks in it.

If you have any other questions or findings ,please also feel free to post
here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support
 
S

Scott Allen

Hi Max:

Just thought of this: Check in the IIS MMC underneath the Application
Pool for your web application. Check Properties -> Recycling to see
how often the application is set to recycle, and (probably more
important), check Properties -> Performance to see if the application
should shut down after an idle period. If there are no requests coming
in for a period of time the application might just shutting down on
you. The approach you are using should still work, but a background
thread listening on a TCP socket won't keep it alive.
 
M

Max Metral

Thanks for the quick reply. I'm having two sorts of strange behavior.
These problems are all on the XP Pro box at the moment, but it has no load,
so I should be under the limit.

First, I'm connecting to MSN using the dotmsn library, and when running in
IIS, I get this strange TCP error:
WSAECONNABORTED -- Software caused the connection to abort. A connection
that has been made was aborted, usually due to connection or protocol error.

Now I would normally say there's something wrong with the library I'm using,
and that's certainly still possible. But it works fine, reliably, from a
console app using the same code.

Also, after some period of idle time, the app unloads. I need it to stick
around indefinitely, and I'm not sure how or if I can do this in IIS...
 
S

Steven Cheng[MSFT]

Hi Max,

Thanks for your followup.
As the first strange thing you mentioned, normally when some thing got
wrong in asp.net web app but works in console or desktop apps, we could
first check security issue. So in spite of the dotmsn library's problem, we
can try changing the asp.net's process identity to SYSTEM ACCOUNT in the
machine.config file and perform the same test to see whether it helps.

And regarding on the second problem that app unload, Scott has mentioend
the idle restart setting in Application Pool under IIS6 win2k3 server. As
for winxp or 2k iis5, there is no Application Pool setting , but there
seems to have another issue on the asp.net worker process restart after
some certain idle period:

#The ASP.NET worker process restarts before the timeout setting has lapsed
http://support.microsoft.com/?id=841557

Please have a look, if there is any other questions, please feel free to
post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi Max,

Have you got any further ideas or progress on this issue? If there is
anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top