Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi There
We just moved one of our .Net applications from a Windows 2003 Server to a virtual Windows Server 2008 R2 (64Bit, VMWare).

This application is a simple console application running on .Net Framework 4.0, 32Bit, that runs different jobs to select, modify and save business data to a database. For the database we use SQL 2008 R2.

Since we run the application on the Windows Server 2008 R2 we recognized, that the execution of Select-Statements with LINQ to SQL are slower than on the Windows Server 2003 we used before. We checked it with a simple LINQ Query, and that tooks about 500 milliseconds longer on Win 2008.

We use the System.Data.Linq.DataContext and get Objects from the Database with the Method GetTable<classxy>().

To compare te duration we took the time from creating the datacontext until the mapping from the DB-Objects back to the .Net-Objects in the application.
See the code:

SQL
System.Data.IDbConnection testConnection;
            System.Data.Linq.Mapping.MappingSource testMappingSource;
            ...
            ...
            using (System.Data.Linq.DataContext dc = new System.Data.Linq.DataContext(testConnection, testMappingSource))
            {
                dc.DeferredLoadingEnabled = false;

                return  = (from dbObject in dc.GetTable<testtable>()
                          select dbObject).FirstOrDefault();
            }</testtable>


On the Windows 2008 R2 Server, the .Net Framework 4.0 is installed, and in the server features the .Net Framework 3.5.1 Features are enabled.

The application was installed on three different stages (Dev, Test, Production) on three Windows 2003 Server. Now it runs on three virtual Windows 2008 R2 Server. We have the same Problem on all three Windows 2008 R2 Server. And we even tested it on a physical Windows 2008 R2 Server; same Problem there.

Has anynone an idea what causes this difference? And what may be solution to resolve this problem?

Thanks a lot in advance!
Greets
Tom
Posted
Updated 1-Sep-11 22:52pm
v2

From what I gather from your description you are running your tests in a VM now, if this is the case a slower time is to be expected.
 
Share this answer
 
Comments
aeschli666 2-Sep-11 10:03am    
We assume that too. But we also made the same tests on physical windows 2008 R2 server, and there we got the same problem.
Mehdi Gholam 3-Sep-11 0:17am    
That is interesting... in my experience windows 2008r2 is faster on the same hardware.

To narrow down your problem:

Q1) Try splitting your test into memory/cpu , network access and disk access stages to see which part is slower

Q2) Have you installed all the latest drivers on your machine.
One place to look at is the SQL Server profiler. Check if the statement is the same from both 'clients' or does it have differences.

If both clients generate the same SQL statement then you could also check client side settings. For example, if you're fetching lot's of data, the network packet size should possibly be modified to be the same as in the 2003 server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900