We have a database server application which consists of the followings components:
1) A service application with a database that accept web service calls
2) A worker application (exe) which makes a web service request to the service application to get some work. Then it does some work and updates the database directly and then call another web service request to let the service application know that work has been finished.
We run a number of worker applications (in other words run the executable several times so there is more than one instance of it running) so each one can request work from the service application and carry on working without other workers applications interfering.
If I move this application a machine with multiple cores, is there a way of splitting the worker applications on different cores and at the same time have a service application on a different core?
Since I run the same application worker several times, apart from putting some code in that checks how many instances of it are running on different cores, I cannot see how I can do this.
In past tests, I see all the worker applications running and the service application running on the same core, which is maxing it out while I have 3 cores doing nothing.
Any ideas?
JD.
Not a good idea to manually force each application run over a specific core.
There are multiple issues.
What if you moved to another machine with two cores (changing the code is not a good idea).
You will create bottlenecks for your application because there are other system tasks for operating system and also there are other applications on the same machine and your application on core 3 is waiting for a time-slice while core 2 is free, but you told
OSto run it over core 3. You don’t have control over external factors. RememberOSwill use sophisticated algorithms for task scheduling and its hard to do it better thanOS.WHat I suggest is using
Task Libraryof.NET 4.0inside your application. It would decide how to use multiple cores of your machine in an effective way.