通过WCF迁移到客户端服务器。我的第一个WCF。
Moving to client server via WCF. My first WCF.
由于没有Web客户端主机在内部服务?? 的思考 在以后将创建一个姊妹产品和主机在Azure上 思维,要求会议?? 如果我想错了,请让我知道我在哪里输了就是为OperationContract的实例和并发性。
Where I am lost is is OperationContract Instancing and Concurrency.
有关的搜索实例化,我应该去PerSession?如果是的话,我应该保持SQL连接打开?
For search Instancing should I go PerSession? And if so should I hold the SQL connection open?
更新是从搜索方式不同。有6个不同的更新OperationContracts(对于不同的数据类型)。更新是一次一个,并经由PK和将达到源表和日志表。这可能更有意义作为单个实例和ConcurrencyMode多发,并保持连接?如果是这样,我管理并发?
Update is way different from search. There are 6 different update OperationContracts (for different data types). Update is one at a time and via the PK and will hit the source table and a log table. That may make more sense as a Single Instance and ConcurrencyMode Mutiple and hold the connection? If so I do I manage concurrency?
还有一个批量更新,但我愿意只把它作为一个系列单更新的现在。
There is also a bulk update but I am willing to just treat it as a series of single updates for now.
主要目标是数据的完整性,然后可用性,然后可扩展性。
Primary objective is data integrity, then availability, and then scalability.
据我所知,可能不会很难回答。任何指针或引用的材料?我应该如何进行压力测试?如何mangage和监督的过程?
I understand there may not be hard answers. Any pointers or reference material? How should I stress test? How to mangage and monitor the process?
有大量的数据来测试的,我会报告结果。
Have a lot of data to test against and I will report results.
找了个博客,直接解决了我的问题。
Found a blog that address my questions directly
WCF的实例化,并发和节流部分-1
WCF的实例化,并发和节流部分-2
WCF的实例化,并发和节流部分-3
PerCall 您可以考虑在这些情况下,这个实例化模式。
PerCall You may consider this instancing mode in these circumstances.
如果你的服务是无状态
If your service is stateless
如果您的服务具有重量轻初始化code(或没有)。
If your service has light-weight initialization code (or none at all).
如果你的服务是单线程的。
If your service is single threaded.
我的方法适合所有的这些标准。一旦信道被创建InstanceContextMode PerCall的开销不超过创建类的实例更。连接到SQL的开销也很小,因为它会举行一个连接池。我正在这太复杂了。
My methods fit all those criteria. Once the channel is created the overhead of InstanceContextMode PerCall is no more than creating an instance of a class. The overhead of connecting to SQL is also small as it will hold a connection pool. I was making it too complex.
如果有人有更多的补充,那么我会很乐意接受你的答案。
If someone has more to add then I would be happy to accept your answer.