IIS - IIS migration caused file server slow down

Asked By Henry Taylor on 31-Aug-15 02:07 PM
We had an old iis6.x 2003 web server and web site that accessed a file server to retrieve statements for our financial clients.  A web page would look to the file server and read the file names in directories and display a list for the user to select from.

We migrated to iis7.x 2008 web server but left the file server as it was.  The web site runs fine.

The retrieval of file names on the new web site is painfully slow.

All of these machines are on the same domain behind our firewall.

Does any one know why the new web server seems to have a problem retrieving the file names from the same old file server?

Thanks.
Robbe Morris replied to Henry Taylor on 31-Aug-15 02:26 PM
Does your new server have anti-virus software running on it that might be behaving differently than expected?  I'd try disabling it temporarily and see if that helps.

I'm guessing the file server is locked down to prevent authorized access to files.  Does the code that iterates the folders use a single Active Directory account (what the app pool runs under) or are you using the passed through windows authentication credentials of the end user?
Henry Taylor replied to Robbe Morris on 31-Aug-15 03:34 PM
The list of files is obtained with:

Dim dirInfo As DirectoryInfo
......
dirInfo.GetFiles("*.*")

and loaded into an Array.

We shut down the anti-virus software and it made no difference.

Once I get files for one client I can switch clients and the new list returns pretty quick.

It is like once code is in iis memory it runs well but if it gets knocked out by something else it has to reload and then takes a while to return the first list of file names.

I just learned this is a virtual machine running on the same physical machine as the old web site.
Robbe Morris replied to Henry Taylor on 31-Aug-15 04:23 PM
Check your event log to see if there are any unhandled exceptions.  I've seen odd behavior when there are corrupt files in a folder or directory or folder names that are too long.  I've also seen this if there are a large number of files in a given folder.

Can you run this code in your dev environment on your own machine to step through some of the same folders in production?
Henry Taylor replied to Robbe Morris on 31-Aug-15 05:38 PM
I don't see any events that might tell me something is wrong.

I had it wrong a while back. This thing runs worse and worse as time goes on.

Unfortunately it runs pretty slow through the IDE also.

I'll get back at it tomorrow.  Thanks Rob.
Robbe Morris replied to Henry Taylor on 31-Aug-15 07:11 PM
If you want, you can email me the applicable code and I can see if there is anything obvious.  info@nullskull.com
Henry Taylor replied to Robbe Morris on 03-Sep-15 09:02 AM
UPDATE:

The server that is not responding well was a Hyper-V 2003 machine UPGRADED to 2008.

We put the files on a Hyper-V machine that had a CLEAN INSTALL of 2008 and it works fine.

We are left to wonder if the UPGRADE process is the problem and if so how to fix it?

PS - Sorry about the name misspelling Robbe
Robbe Morris replied to Henry Taylor on 03-Sep-15 09:38 AM
Interesting.  It could be any combination of a million things.  And, I bet other issues will come up as well.

Nice job at nailing down a solution.
Henry Taylor replied to Robbe Morris on 03-Sep-15 09:57 AM
If we nail down the exact cause I will post it here.

I hate it when people have problems then reply "Never mind I fixed it" then hang up!
Henry Taylor replied to Robbe Morris on 11-Sep-15 09:52 AM
We doubled the available RAM to 4 (as recommended) and that seems to have fixed the problem.
Robbe Morris replied to Henry Taylor on 11-Sep-15 09:57 AM
You only have 4GB of RAM running on your server?  That's not enough under normal circumstances.  You can pretty much count on the operating system using around 2GB and another 2GB for various processing under mid to heavy load.  That doesn't leave you much room for periodic spikes in activity or load.