Foreach Slowing Down?

I’ve got a server running SQL Server 2005 on EC2.  I know there’s criticism of EC2 for database use due to S3’s relative disk speed but this is running fast enough - and you’ve got to admit it’s a breeze to deploy a new server!

Recently though, it’s been acting really strange.   First the install onto a brand new (virtual) machine broke with .net somehow becoming corrupted.  I find this extremely odd:

  1. 1)create machine

  2. 2)run windows update

  3. 3).NET does not work

In the end I fixed it by downloading the .net update and running it manually but this isn’t the sort of thing that I can imagine squeezing past MS’s quality control - some weird interaction between EC2 and Windows?  I am sure running a virtual RHEL and then a virtual Windows on top of that isn’t healthy.

Anyway, the issue that I haven’t fixed is that I’m getting files sent to me bundled together in a zip file and processing them using a standard foreach loop.  Running locally this works fine.  Running remotely however this seems to result in the load gradually slowing down to a crawl.  Clearly there is a funny interaction going on somewhere but what? and where?

To be honest, I’m hoping to not have to resolve this by migrating off 2005 and hoping it just goes away.  It just seems to random to be something that’s easy to find.  However I thought I’d put it out there in case either someone reading this happens to know the answer, or this post helps someone else in a similar situation