Guest Eddie Posted October 5, 2007 Posted October 5, 2007 We have an odd situation with some of our single-threaded CPU-bound C++ programs. They run between 2 and 4 times faster on Windows XP than on Windows Server 2003 on the same Xeon hyperthreading dual processor machine (we borrowed one from our IT department, and have been alternating these two operating systems on it.) Even more odd, if we run a Virtual PC with Windows XP on top of the Windows 2003 Server on the same Xeon machine, this runs faster too. There is nothing else running on the machine during these tests, both operating systems show the expected 25% CPU usage. Next I tried running the programs on my Core 2 Duo with Windows XP, and comparing this with a Virtual PC running Windows 2003 Server on top of Windows XP on my machine. This showed negligible difference in run-times, and the expected 50% CPU usage. We think, but are not sure, that the slowing down on 'native' Windows 2003 Server is something to do with memory cache misses. This seems to be the only thing our profiling tool (AQTime) shows to be substantially different when we run our programs. Does anybody have a similar experience? Is this a 'known fact'? Is there anything we can do to our programs to make them run faster on Windows 2003 Server? I'm not sure I'm asking the right forum, if I'm not where would be better? We need to move the programs to a Windows 2003 Server production environment but are very disappointed with the throughput. Eddie
Guest Kerry Brown Posted October 5, 2007 Posted October 5, 2007 Re: Windows Server 2003 vs. Windows XP "Eddie" <EddiesMSDN@community.nospam> wrote in message news:85EBE966-B147-4F87-A334-519E5B4A798F@microsoft.com... > We have an odd situation with some of our single-threaded CPU-bound C++ > programs. They run between 2 and 4 times faster on Windows XP than on > Windows > Server 2003 on the same Xeon hyperthreading dual processor machine (we > borrowed one from our IT department, and have been alternating these two > operating systems on it.) > > Even more odd, if we run a Virtual PC with Windows XP on top of the > Windows > 2003 Server on the same Xeon machine, this runs faster too. There is > nothing > else running on the machine during these tests, both operating systems > show > the expected 25% CPU usage. > > Next I tried running the programs on my Core 2 Duo with Windows XP, and > comparing this with a Virtual PC running Windows 2003 Server on top of > Windows XP on my machine. This showed negligible difference in run-times, > and > the expected 50% CPU usage. > > We think, but are not sure, that the slowing down on 'native' Windows 2003 > Server is something to do with memory cache misses. This seems to be the > only > thing our profiling tool (AQTime) shows to be substantially different when > we > run our programs. > > Does anybody have a similar experience? Is this a 'known fact'? Is there > anything we can do to our programs to make them run faster on Windows 2003 > Server? I'm not sure I'm asking the right forum, if I'm not where would be > better? We need to move the programs to a Windows 2003 Server production > environment but are very disappointed with the throughput. > Server 2003 is optimised for disk I/O and running many programs and services at once. XP is optimised for one user running a few programs. To simulate how a program will run on Server 2003 on an XP computer In System properties on the Advanced tab click on the Settings button under Performance. Then on the Advanced tab set Adjust for best performance to Background services. Don't do the opposite on a server (i.e set to Programs). The server will perform very poorly as a server. -- Kerry Brown Microsoft MVP - Shell/User http://www.vistahelp.ca
Guest Eddie Posted October 8, 2007 Posted October 8, 2007 Re: Windows Server 2003 vs. Windows XP Hi Kerry, thanks for replying. I currently have full control of the Xeon machine, so I tried your suggestion of changing XP on the Xeon to best to performance on background - unfortunately it made no difference. I also tried to change the Windows 2003 Server to best performance for programs, but found it was already set that way (this is not in a production environment). Any other ideas? All the best, Eddie "Kerry Brown" wrote: > "Eddie" <EddiesMSDN@community.nospam> wrote in message > news:85EBE966-B147-4F87-A334-519E5B4A798F@microsoft.com... > > We have an odd situation with some of our single-threaded CPU-bound C++ > > programs. They run between 2 and 4 times faster on Windows XP than on > > Windows > > Server 2003 on the same Xeon hyperthreading dual processor machine (we > > borrowed one from our IT department, and have been alternating these two > > operating systems on it.) > > > > Even more odd, if we run a Virtual PC with Windows XP on top of the > > Windows > > 2003 Server on the same Xeon machine, this runs faster too. There is > > nothing > > else running on the machine during these tests, both operating systems > > show > > the expected 25% CPU usage. > > > > Next I tried running the programs on my Core 2 Duo with Windows XP, and > > comparing this with a Virtual PC running Windows 2003 Server on top of > > Windows XP on my machine. This showed negligible difference in run-times, > > and > > the expected 50% CPU usage. > > > > We think, but are not sure, that the slowing down on 'native' Windows 2003 > > Server is something to do with memory cache misses. This seems to be the > > only > > thing our profiling tool (AQTime) shows to be substantially different when > > we > > run our programs. > > > > Does anybody have a similar experience? Is this a 'known fact'? Is there > > anything we can do to our programs to make them run faster on Windows 2003 > > Server? I'm not sure I'm asking the right forum, if I'm not where would be > > better? We need to move the programs to a Windows 2003 Server production > > environment but are very disappointed with the throughput. > > > > > Server 2003 is optimised for disk I/O and running many programs and services > at once. XP is optimised for one user running a few programs. To simulate > how a program will run on Server 2003 on an XP computer In System properties > on the Advanced tab click on the Settings button under Performance. Then on > the Advanced tab set Adjust for best performance to Background services. > Don't do the opposite on a server (i.e set to Programs). The server will > perform very poorly as a server. > > -- > Kerry Brown > Microsoft MVP - Shell/User > http://www.vistahelp.ca > >
Guest Chris M Posted October 8, 2007 Posted October 8, 2007 Re: Windows Server 2003 vs. Windows XP Eddie wrote: > We have an odd situation with some of our single-threaded CPU-bound C++ > programs. They run between 2 and 4 times faster on Windows XP than on Windows > Server 2003 on the same Xeon hyperthreading dual processor machine (we > borrowed one from our IT department, and have been alternating these two > operating systems on it.) > > Even more odd, if we run a Virtual PC with Windows XP on top of the Windows > 2003 Server on the same Xeon machine, this runs faster too. There is nothing > else running on the machine during these tests, both operating systems show > the expected 25% CPU usage. When you're running XP natively on the dual Xeon hardware, how many logical processors does XP actually recognise? XP should in theory see and make use of all four cores, but I would check just to make sure anyway. If for some reason XP is seeing the four cores as four separate physical CPUs, it will only use two of them (and therefore will only be using one of the Xeons, if you see what I mean) - XP is only licensed for up to 2 physical processors. As far as I know, Microsoft Virtual PC/Virtual Server will only allocate a single CPU to a guest machine. Therefore, you're in the same situation as the above with only one CPU being active. Server 2003 standard edition is licensed for up to four processors, so regardless of whether they look like four separate physical CPUs or not, Server 2003 will make use of them all. If I'm correct, then the only situation where you actually have both CPUs and all four cores being used is when Server 2003 is running on the bare metal of that machine - and there's the reason for your problem. If that is the case, then you may be able to resolve the issue by setting the processor affinity for the process in the Task Manager, but that would only be hiding the underlying problem. Hope this helps! -- Chris M.
Guest Eddie Posted October 8, 2007 Posted October 8, 2007 Re: Windows Server 2003 vs. Windows XP Hi Chris, The operating system on the Xeon recognises 4 processors with both Windows 2003 Server and XP (i.e. 2 hyperthreading processors). These are single-threaded executables I'm testing though. Thanks for your suggestion; I have just set the processor affinity (for one test program on Windows 2003 Server) to one CPU, but alas it did not make any substantial difference, maybe a few percent improvement but not the factor 2 to 4 that occurs with Windows XP. Eddie "Chris M" wrote: > > When you're running XP natively on the dual Xeon hardware, how many > logical processors does XP actually recognise? > > XP should in theory see and make use of all four cores, but I would > check just to make sure anyway. If for some reason XP is seeing the four > cores as four separate physical CPUs, it will only use two of them (and > therefore will only be using one of the Xeons, if you see what I mean) - > XP is only licensed for up to 2 physical processors. > > As far as I know, Microsoft Virtual PC/Virtual Server will only allocate > a single CPU to a guest machine. Therefore, you're in the same situation > as the above with only one CPU being active. > > Server 2003 standard edition is licensed for up to four processors, so > regardless of whether they look like four separate physical CPUs or not, > Server 2003 will make use of them all. > > If I'm correct, then the only situation where you actually have both > CPUs and all four cores being used is when Server 2003 is running on the > bare metal of that machine - and there's the reason for your problem. > > If that is the case, then you may be able to resolve the issue by > setting the processor affinity for the process in the Task Manager, but > that would only be hiding the underlying problem. > > Hope this helps! > > -- > Chris M. >
Guest Chris M Posted October 8, 2007 Posted October 8, 2007 Re: Windows Server 2003 vs. Windows XP Eddie wrote: > The operating system on the Xeon recognises 4 processors with both Windows > 2003 Server and XP (i.e. 2 hyperthreading processors). These are > single-threaded executables I'm testing though. > > Thanks for your suggestion; I have just set the processor affinity (for one > test program on Windows 2003 Server) to one CPU, but alas it did not make any > substantial difference, maybe a few percent improvement but not the factor 2 > to 4 that occurs with Windows XP. Hi Eddie, Oh well, back to the drawing board eh? If I think of anything else I'll let you know. If you get to the bottom of the problem, please post back here because I'd love to know what it was! -- Cheers, Chris M. > "Chris M" wrote: > >> When you're running XP natively on the dual Xeon hardware, how many >> logical processors does XP actually recognise? >> >> XP should in theory see and make use of all four cores, but I would >> check just to make sure anyway. If for some reason XP is seeing the four >> cores as four separate physical CPUs, it will only use two of them (and >> therefore will only be using one of the Xeons, if you see what I mean) - >> XP is only licensed for up to 2 physical processors. >> >> As far as I know, Microsoft Virtual PC/Virtual Server will only allocate >> a single CPU to a guest machine. Therefore, you're in the same situation >> as the above with only one CPU being active. >> >> Server 2003 standard edition is licensed for up to four processors, so >> regardless of whether they look like four separate physical CPUs or not, >> Server 2003 will make use of them all. >> >> If I'm correct, then the only situation where you actually have both >> CPUs and all four cores being used is when Server 2003 is running on the >> bare metal of that machine - and there's the reason for your problem. >> >> If that is the case, then you may be able to resolve the issue by >> setting the processor affinity for the process in the Task Manager, but >> that would only be hiding the underlying problem.
Guest Eddie Posted October 11, 2007 Posted October 11, 2007 RE: Windows Server 2003 vs. Windows XP Problem solved! It was a file mapping option that caused it to slow down. The programs now run marginally faster on Windows 2003 Server. Phew. Eddie
Guest Eddie Posted October 12, 2007 Posted October 12, 2007 RE: Windows Server 2003 vs. Windows XP I'll explain the fix in more detail - and how the situation occurred. I hope this will help others if they see a similar problem. The code we use for file mapping in a suite of programs was written some years ago, at that time the MSDN library suggested that the EC_NOCACHE flag in "CreateFileMapping" could be beneficial - and indeed it showed a modest increase in run-times for some of our programs on Windows XP (about 5%, which is good when some of these programs take a few days to complete). We recently tried some of these programs on Windows 2003 Server and the results were bad, as I mentioned earlier. Of course we had completely forgotten about this option; the number of lines of code in these programs is very large. The latest MSDN library does not recommend using the flag, except where essential. We removed it in one program, and Windows 2003 Server now runs this program somewhat faster than Windows XP. The run-time on XP has slowed down a little, as already explained. We are now investigating the use of this option on Vista, XP, 2003 Server and 2000 Server as well as with all the other programs we have. Eddie "Eddie" wrote: > We have an odd situation with some of our single-threaded CPU-bound C++ > programs. They run between 2 and 4 times faster on Windows XP than on Windows > Server 2003 on the same Xeon hyperthreading dual processor machine (we > borrowed one from our IT department, and have been alternating these two > operating systems on it.) > > Even more odd, if we run a Virtual PC with Windows XP on top of the Windows > 2003 Server on the same Xeon machine, this runs faster too. There is nothing > else running on the machine during these tests, both operating systems show > the expected 25% CPU usage. > > Next I tried running the programs on my Core 2 Duo with Windows XP, and > comparing this with a Virtual PC running Windows 2003 Server on top of > Windows XP on my machine. This showed negligible difference in run-times, and > the expected 50% CPU usage. > > We think, but are not sure, that the slowing down on 'native' Windows 2003 > Server is something to do with memory cache misses. This seems to be the only > thing our profiling tool (AQTime) shows to be substantially different when we > run our programs. > > Does anybody have a similar experience? Is this a 'known fact'? Is there > anything we can do to our programs to make them run faster on Windows 2003 > Server? I'm not sure I'm asking the right forum, if I'm not where would be > better? We need to move the programs to a Windows 2003 Server production > environment but are very disappointed with the throughput. > > Eddie
Recommended Posts