Charmi Amipara
Charmi Amipara

Reputation: 1

What methods can be used to monitor or limit memory usage of a WCF service with multiple services running?

I’m trying to monitor the memory usage of the service to get better performance, but I can not find any valid method to do so which gives the equivalent value to the memory column of task manager. Second problem is that, on single server there are multiple services that are running. Due to high memory usage of 1 service, it will impact others. To avoid that, I’m trying to limit the memory usage for particular service, but can not find a way to do so. Can anyone provide any methods or files that needs to be changed in order to solve these 2 problems?

I tried using Process & PerformanceCounter classes of System.Diagnostics, but didn't get desired solution.

Upvotes: 0

Views: 50

Answers (1)

QI You
QI You

Reputation: 518

I think setting a maximum value for the transfer size is the easiest and most effective way to do it. We just need to set a value that keeps the server from overloading.

MaxReceivedMessageSize:Gets or sets the maximum size of messages that can be received on the channel configured with this binding

For Example:

<bindings>
  <customBinding>
    <binding name="customBinding">
      <binaryMessageEncoding>
      </binaryMessageEncoding>
      <httpTransport maxReceivedMessageSize="2147483647">
      </httpTransport>
    </binding>
  </customBinding>
  <basicHttpBinding>
    <binding name="basicBinding" maxReceivedMessageSize="2147483647"></binding>
  </basicHttpBinding>
</bindings>

Upvotes: 0

Related Questions