Visit Citebite Deep link provided by Citebite
Close this shade
Source:  http://rentacoder.com/CS/blogs/real_life_it/archive/2006/03/19/448.aspx

Community Server for Rent a Coder

How Software Gets Done
Welcome to Community Server for Rent a Coder Sign in | Join | Help
in Search

Real Life Microsoft IT

Classic ASP: Not ready for prime-time?

There is a VERY bad problem with Active Server Pages (ASP...or what is sometimes known as "classic ASP") which prevents it from being a viable system on which to build a "big IT" project.  For 2 years we've been fighting a problem in which the IIS (Internet Information Server) 6.0 web servers will run fine for a while.  But then after 18-20 hours, every pages will stop running properly and instead display random errors (that change from refresh of the page to refresh).  The errors always say things like "Cannot find property or method" regarding classes that do exist, or "Cannot create object".  The exact propery or object changes from "refresh" to "resfresh"...even on the same page. Restarting will fix the problem for an hour or so...but then it reoccurs.  Only a hard reboot will fix it for another 18-20 hours.  And then the cycle repeats itself.

We started a ticket over 2 years on this.  Today Microsoft acknowledged the problem publicly with a KB article: http://support.microsoft.com/?scid=kb;en-us;914156

Basically the problem is that ASP fragments the heap under certain conditions:
1) When an app uses INCLUDE files
2) When an app uses significant memory
And it doesn't defragment the memory and as a result, will ALWAYS crash IIS in this way.  The new restart services of IIS 6.0 don't help, becuase only a hard reboot can truly get rid of the defragmentation. 

Of course, two things that any site that has any sophistication has lots of INCLUDE files and any site that has any traffic uses lots of memory.  If both of these apply to you, your ASP site is in trouble.  This is what's called a "bug" in my book.  I'm sure if ASP were MSFT's current technology they would have to fix this.  But Microsoft has moved on to ASP.NET...so I suspect the incentive is pretty much nil.

If you look at the KB article, Microsoft gives a "workaround" (which is the same workaround that they suggested to us).  The workaround is to rewrite your INCLUDE files as COM objects.  The article sites a # of benefits like speed, etc..

The KB was probably written by a systems engineer who knows alot about running systems, but has no idea how computer software is developed, and how impractical this workaround is in the real world.  In a previous position we went down the COM object route.  We did it for other reasons...becuase it was the Microsoft "best practice" at the time.  It's obvious why it no longer is.  The problems we ran into were:

1) Memory: COM objects have a known memory leak problem.  If two COM objects reference each other and you set them to Nothing, they don't clear themselves in memory as they should.  The problem is due to the internal way that COM objects work and was fixed in .NET with a rearchitecture.  But that isn't an option for you if you use COM objects.  This COM memory leak bug will cause your machine to eventually crash, EVERY TIME.

2) Slowness to initialize objects:  COM objects are not designed to be created and destroyed thousands of times like .NET objects.   Our object rich COM model running on the internet was VERY slow...some pages took 5-10 seconds to render.  One way to work around this is to not use objects in COM, but instead use functions.  But of course, this "solution" causes almost as many problems.  A non-object oriented framework is exponentially more difficult to debug and maintain which makes delivering the code on time and on budget frustratingly (and unnecessarily) difficult.

3) Slowness to develop:  This was a real show stopper.  Every time a change is made in the COM object code (the COM object has to be completely recompiled from scratch, which took 2-3 minutes on a state of the art machines (This # could vary depending on the size of your COM objects).  Also, many times IIS would lock the COM object .dll,  so in addition, IIS had to be stopped and restarted too, which took another minute or two.  (The latter might be alleviated with object pooling, but all the other negatives forced us to abandon COM before even looking at this possibility).

How does this affect things?  When code is created, it is never right the first time.  Even creating a single function is an iterative process where it's coded, run, bugs are removed, and the process repeated.  A typically complex function created by a top notch developer might require 3-4 iterations...and an average developer might require 10,15 or more.   Being able to iterate quickly is what allows you to deliver it on time and on budget.  If creating just a single function requires 9 more minutes for your "star" developer and 30 more minutes for your average developers, you are going to have problems.  It is FRUSTRATINGLY difficult to develop under these circumstances and try to meet time and budget commitments.

I tried to explain to the Microsoft systems engineer why this was impractical, but simply got the standard "spiel" repeated to me that COM objects were wonderful and the way to go.  Obviously he believed something he read from a KB article, more than me, who he did not realize had personal experience with this supposed "solution". 

Conclusion: If you develop a web app with any sophisticiation or any size, ASP (classic ASP) is NOT a suitable or scalable environment for you.  Instead go to a non Microsoft platform.  If you choose to say with Microsoft, choose the newer ASP.NET.

Ian Ippolito

Published Sunday, March 19, 2006 11:56 AM by admin
Filed Under:

Comments

 

pirklk said:

I feel your frustrations with this.  One of our internal application (ASP) has the same type of issue..  I just wanted to say thanks though as this little tid bit of infomation was what I was looking for as a root cause of our problem.  Excellent bit of knowledge to have.  

Thanks
April 7, 2006 5:32 PM
 

mariano.iglesias said:

Ian, I simpathyze with the hopeless sense everybody at RAC staff must be feeling now. I can imagine you may get tons of emails from coders & buyers demanding better web site performance. Being a RAC coder myself (http://www.rentacoder.com/RentACoder/SoftwareCoders/showBioInfo.asp?lngAuthorId=1033162) I do understand the frustration of needing to upload deliverables or send status reports, while being afraid a timeout error may occur at that time. Or worst, that the financial information each coder/buyer has on the site, may be affected by poor software behaviour. However, I also know that you guys are doing the best you can, so there's no complain from our side.w

Seeing that it's been some weeks that you are trying different Microsoft suggested fixes, what is the next step for RAC? Are you going to take the .NET road or are you planning on a complete makeover?
April 22, 2006 12:57 AM
 

edabdoub said:

Hi

I'm a rentacoder buyer from a long time ago.
It is a great site and has helped me a lot.

However, since .net came out (2002). I have been asking myself why you havent upgraded to .NET . Sincerelly I think that classic ASP is a pain in the a** and you can agree with that too.

I know that RAC is a huge web application, but I supposse that you have a Data tier (SQL procedures) that will not change and come on! you have access to thousands of the best coders of the world. I think that any offshore coder (or team of coders). Could redo RAC in 1 month for less than 10,000 USD. I think it would be worth the investment.
April 26, 2006 1:19 PM
 

admin said:

Mario,

Thanks for the sympathy.  ASP actually isn't the worst of our problems with the Microsoft stack (SQL Server 2005 takes that honor by a wide margin...see the other entries in this blog).  With ASP...currently the short term solution is that we've purchased 3 servers and reboot them often to prevent the memory problem from occuring.  As a result we only see this problem a few times a month, instead of many times a day.  Long term, yes we are going into .NET, because the only solution is to go forward with technology.  We were waiting until "edit and continue" was implemented (due to the loss of productivity without that feature)...and now that it has, are waiting for SP2 to get the bugs out and the release is considered stable.  Then we'll take a look at the conversion.  It will be done piecemeal to minimize risk as well as downtime to the site users.

Edabdoub,
It's a little bit more difficult than you've suggested. :)  Your off the cuff "estimate" is about 10x-20x too low. Remember that most sites are like an iceberg...you only see a small portion of them.  The main portion is all the adminitration screens that go on "behind the scenes".

Ian Ippolito
RentACoder.com
April 26, 2006 6:22 PM
Anonymous comments are disabled

This Blog

Post Calendar

<March 2006>
SuMoTuWeThFrSa
2627281234
567891011
12131415161718
19202122232425
2627282930311
2345678

Post Categories

Syndication

Powered by Community Server, by Telligent Systems