Silverlight WCF 性能问题
我有一个从 Silverlight 访问的 WCF 服务(不是 RIA)。该应用程序具有快速传入的数据,当然还有 twitter 数据;),这些数据被写入 SQL Server 数据库。 WCF 服务位于一个单独的 Web 项目中,我每 10 秒从 Silverlight 轮询一次服务器。
我注意到它最近速度减慢,可能是由于数量的原因,尽管我将每个请求限制为 100 个对象(向所有查询添加 Take(100) 语句)。
我在 WCF 服务的构造函数中放置了一条 debug.writeline 语句,输出窗口显示它为每个请求构建,我认为这很糟糕,因为我愚蠢地将不同存储库等的构造放在那里,因此每个请求必须发出几个新的对象上下文。
除了轮询服务之外,Silverlight 是否还有其他方法?对于经常需要少量(<=100 个对象)数据的客户端场景,如何最好地设置 WCF 服务?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看 HttpPollingDuplex 绑定或类似 http://laharsub.codeplex.com/ 的内容
You could take a look at the HttpPollingDuplex binding or something like http://laharsub.codeplex.com/