Brian
Brian

Reputation: 3713

Can WCF connection throttling be changed at runtime?

I have a WCF web service that has ServiceThrottlingBehavior configured at startup, the code for which looks something like this:

  'config service throttling
  If objWSParams.bUseServiceThrottling Then
    Dim stb As New ServiceThrottlingBehavior
    stb.MaxConcurrentSessions = 100                '1-1000
    stb.MaxConcurrentCalls = 100                   '1-1000
    stb.MaxConcurrentInstances = 100               '1-1000
    ServiceHost.Description.Behaviors.Add(stb)
  End If

My architects and I are talking about making our web service more "load dynamic" so that performance settings can be adjusted based on load.

Does anyone know if ServiceThrottlingBehavior can be reset at runtime, or does the service have to be restarted before changes kick in?

Upvotes: 0

Views: 176

Answers (1)

Brian
Brian

Reputation: 3713

The answer is, unfortunately, No. According to MS, the ServiceThrottlingBehavior can only be set on startup and cannot be changed during runtime. This, of course, means that dynamically managing the web service as conditions change on the server is impossible unless you want to take your web service offline on a regular basis.

Disappointing.

Upvotes: 1

Related Questions