Why is the server performance so poor? What can be done to improve the speed of the server

windows-server-2008

Very slow processing using Windows Server2008 R2 Standard with Service Pack One.
Situation:
Read a text file using the text data to populate a series of MS Sql tables. The converted data is used to generate monthly PDF invoice files; the PDF files are saved directly to the hard drive. The application is multi-threading with one thread used for the text conversion and three threads for PDF invoice generation. The text conversion is occurring concurrently with the invoice generation.

Application Software:
C# using Microsoft Visual Studio 2010 Ultimate.
Crystal Report Writer 2011 with runtime 13_0_3 64 bit version.
Targeted platform is x64; also tested as x86, and Any CPU with similar results.
Microsoft .NET Framework 4.0.
Microsoft Sql 2008

Issue:
The software is running very slowly. The conversion of the text file is approximately six hundred fifty records per second and generation of the PDF files is approximately twelve invoices per minute. The text file to be converted is six hundred Meg with seven thousand invoices to be generated.

The software was installed on three different machines from the same distribution files. The same text file was converted on each machine. The user executing the application was an administrator on each machine. The only variances were the machine and operating system. The configurations are as follows:

Server:
Operating System: Windows Server2008 R2 Standard 64-bit (6.1, Build7601) SP1
Service Pack:
System Manufacturer: IBM
System Model: System x3550 M3-[7944AC1]-
BIOS: Default System BIOS
Processor: Intel® Xeon® CPU E5620@ 2.4GHz (16 CPUs)
Memory: 16384MB

Notebook:
Operating System: Windows 7 Home Premium Standard 64-bit (6.1, Build7601)
System Manufacturer: Hewlett-Packard
System Model: HP Pavilion dv7 Notebook PC
BIOS: Default System BIOS
Processor: AMD Phenom II N640 Dual-Core Processor 2.9GHz (2 CPUs)
Memory: 6144MB

Desktop:
Operating System: Windows 7 Professional 64-bit (6.1, Build7601) SP1
System Manufacturer: Dell Inc.
System Model: OptiPlex 960
BIOS: Phoenix ROM BIOS PLUS Version 1.10 A11
Processor: Intel Core™2 Quad CPU Q9650 @3.00GHZ (4 CPUs)
Memory: 16384MB

Processing results per machine:

The applications were executed seven times with the averages being displayed below.

Machine     Text Records        Invoices Generated
            Converted Per Minute        Per Minute


Server (1)      650             12
Notebook        980             17
Desktop         2,100               45

(1) The server is dedicated to execution of this application; no additional applications are being executed.

Question:
Why is the server performance so poor? What can be done to improve the speed of the server?

Best Answer

One of the differences between client and server versions of Windows lies in the "Advanced" tab of the "Performance Options" screen in "System Properties.

Adjust for best performance of: Programs or Background services.

Client SKUs are set to Programs by default, and Server SKUs are set to Background services by default.

What that setting really does is adjust the Thread Quantum of the operating system. The thread quantum is the amount of time a thread is allowed to run before the thread scheduler makes a decision to schedule another thread for execution, or to continue letting the current thread execute.

The "Background services" or "Server" setting makes the thread quantum much longer. This means reduced context switching, and it means that a server thread has a better chance of servicing a request to completion before getting interrupted by another thread.

As of Windows 7 and 2008 R2, it's the difference between 2 clock intervals per thread quantum versus 12 clock intervals per thread quantum.

This could lead to performance issues on multi-threaded applications running on servers if the workloads of the various threads are mismatched in such a way that actually makes context switching desirable.