I have a server application which reads messages off a queue and writes them in a database by calling stored procedures. It is written in C# targeting .NET Framework 3.5.
The server is XEON 2.4Ghz (16 cores)
In my Build properties I had the Platform Target as "Any CPU". The result was in the server, all cores to run constant at 100% but the application was running slow!
I changed the Platform Target to be x86 and when running on the server is running much faster than before and the Cores are around 20-30% load.
I can't really explain what is happening.
Any ideas?
Well, doesn't make a lot of sense. But you are running with a very different dbase provider. The 64-bit versions of them are relatively new and might not have gone through the same kind of rigorous testing and optimization as their 32-bit versions.
Still, a program like this should always block on the queue read and the dbase write. I/O is always slow, much slower than raw code. Only when the thread blocks on an I/O request will it use less than 100% of the CPU cycles.
Do make sure that it isn't throwing and catching exceptions frequently. That's expensive and easily gobbles up all CPU resources. Visible while debugging in the Output window.