WCF Service for many concurrent clients and database access

前端 未结 3 1961
无人及你
无人及你 2021-02-05 21:45

I\'m new to WCF services and wondered what the best way to tackle the following would be.

I have many clients (~200 - ~500) that are all making requests of my service fa

3条回答
  •  -上瘾入骨i
    2021-02-05 22:18

    We have a similar scenario and we solve it using only one conection from our WebService to the DB and using MARS from SqlServer that works perfectly and pretty fast. Sql Server really knows how to handle concurrent queries you don't must think in that.

    You avoid with that the overhead of open and close the connections (obviosly that connection pooling helps in this case)

    Remember also to add in your web service something like:

      [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
            ConcurrencyMode = ConcurrencyMode.Multiple)]
    

    And in the config:

    
    

    This option is inside

      
          
            
    

    Hope this helps :)

提交回复
热议问题