0
votes

I am developing a WCF Data Service over an Entity Framework 4.0 data model, but there's no way we can go to Production under the current circumstances.

My client application is adding and modifying a lot of objects, around 100,000. Then it calls the service's SaveChanges method to persist all changes in a single action. The WCF Data Service is hosted in an NServiceBus host process, although I don't know if that contributes to the issue.

This works, but it takes more than an hour on a 1-CPU, 4GB RAM, Win2008 x64 virtual machine. More importantly, CPU utilization goes up to 100%. RAM consumption fluctuates between 75% and 85%. This is in a development environment virtual machine, so the SQL Server 2005 database the service is covering is local. The WCF Data Service's host process eats up around 1.2 GB during this process.

Any ideas?? Many thanks in advance!

1
The memory consumption can be accounted for easily. But have you looked at which service eats up the CPU time so badly? - Kangkan
I thought it was the WCF Data Service's host process that was taking up the time, but it wasn't... The WCF Data Service is actually hosted in IIS, it is the client that is hosted in an NServiceBus host process. So, it is the client that is taking up almost all of the time (again, fluctuating -- between 85% and 98% of CPU time). - Roy
Profile your application. This is the first step for any performance problem. - Craig Stuntz

1 Answers

0
votes

Do you really need to modify all objects within one transaction? If no, then I would propose to hold the data context open as shortly as possible.

  • Open data context
  • update the object
  • save changes
  • close data context