So, lately I have been getting a variety of questions about non-IIS but related issues. This is a slippery slope... but let me see how far it can go.

Question:

dear david:

I have a problem about the application pool ,it will crash after some Connection_Abandoned_By_AppPool errors. I know what happened, what I want to know is how to prevent it. coz I run a application which access another application to get data on schedule. The application access a realtime database which may not response on time, this will cause the Connection_Abandoned_By_AppPool problems. On this situation, how can I prevent these errors to make it looks working well?

Many thanx!

Answer:

It is not clear to me why this is a problem about the application pool. You seem to indicate that the problem is with the application that you are running which crashes when it accesses a realtime database which may not respond on time.

So, the problems which cause Connection_Abandoned_By_AppPool, as stated by you, are:

  1. The application crashes when it cannot get the data in time
  2. The database is not really "realtime" when it should be

Now, you are interested in preventing the Connection_Abandoned_By_AppPool problems, which means you need to either:

  1. Fix the application to not crash on error conditions such as not getting the data in time
  2. Fix the database to be "realtime" so that it responds appropriately

Other than directly fixing the cause(s) of the crashes that cause Connection_Abandoned_By_AppPool, you have no alternatives to prevent errors to "make it looks working well" when things are not working well. Why?

Well, suppose someone is making a query against your web application looking for some information that is only in the database. If you do not fix the problems in your application/database, then they can fail to retrieve the information for the user's query. Now what do you do to "make it looks working well"? The user is expecting an answer, your application does not have the answer and cannot retrieve it, and you say you do not want the user to see any problems... so are you going to fake an answer?

Maybe you can introduce a highly-available data-caching layer on top of the database such that all queries do not need to go to the database all the time, but this data could be stale. Plus, you now introduce the complexity of a data-caching layer with its own bugs... without fixing the original bugs in the other application nor the database issue. Whether any of this is worth it - that is for you to decide at an architectural level. Hey, you have to think about this stuff. :-)

In general, I advocate users to identify and fix the actual problem, not just "make it looks working well", because otherwise you tend to end up with complicated hacks that may not delay the inevitable.

//David