1

I have a WCF service (not RIA) that I access from Silverlight. The application has fast incoming data, twitter data of course ;) which is written to a SQL Server database. The WCF service is in a separate web project and I poll the server every 10 seconds from Silverlight.

I've noticed it slowing down recently, probably due to volumes, although I limit it to 100 objects per request (adding a Take(100) statement to all the queries).

I put a debug.writeline statement in the constructor for my WCF service and the output window showed it constructing for each request, I think this is bad as I stupidly put my construction of different repositories etc in there so each request must be making several new objectcontexts.

Is there anyway for Silverlight other than polling the service and how best is it to setup a WCF service for my scenario of clients wanting small amounts (<=100 objects) of data frequently?

3
  • Hi, while I believe it's fine to create a new WCF service class for every incoming request, I believe you would be able to enhance performances having some caching logic if the data you load is mostly similar... Commented Mar 28, 2011 at 8:02
  • Yeh I was hoping there as a setting someone knew about to save it keep creating new instances perhaps caching or maybe just use singleton on ninject might be enough. Commented Mar 28, 2011 at 9:07
  • I helped performance by separating the web project into two, as I did have one web project hosting both the XAP and the WCf service. This seemed to help alot. Commented Mar 29, 2011 at 15:35

1 Answer 1

2

You could take a look at the HttpPollingDuplex binding or something like http://laharsub.codeplex.com/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.