Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6697759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:29:54+00:00 2026-05-26T06:29:54+00:00

We have a website load balanced across two servers that calls into a WCF

  • 0

We have a website load balanced across two servers that calls into a WCF wsHttp service hosted on a single IIS7 application server.

Last week, the website was launched and we hit performance problems.

The system was built by an off-shore team but I was asked to investigate if I could help.

I loaded perfmon and used the asp.net counters to view current sessions. I could see that once this increased above about 25 then the website slowed greatly. It would continue to increase to approx 250 over the course of the following 10 minutes, it would then drop to 0 and performance of the site would be great.

This continued in a cycle – bad news!

The following day, the off-shore team informed me that they’d fixed the problem by tuning off security.

I have a theory that in disabling the security on the wsHttp binding WCF changed from creating an instance per session to a creating an instance per call – therefore allowing a far greater throughput of service requests. Is this a good theory?

I’ve built a simple model to test this, a couple of methods hosted in IIS and a simple client that generates multiple requests. This does seem to give the results I’d expected. Problem is, I’m struggling to find the correct perfmon counters to prove that fewer requests are queued and more concurrent instances created, when the secure binding is not used.

Could anyone please advise on the best perfmon counters to use?

OK, another day on this and a more questions!

In my test app, I now have 3 service classes with 3 different wsHttp bindings

  1. No security
  2. Message Security
  3. Message security but with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] set on the class

From within a loop of 40 on the client I start a new thread and call the service. When calling service 1, the service completes all requests within 1 second.

When calling service 2, the service completes all requests in 33 seconds.

When calling service 3, I’d expect it to be almost as quick as service 1 since I’d expect the service to instantiate a new service object for each of the 4 calls. However, it doesn’t seem (I still don’t have any meaningful perfmon counters!) to do this and total time to complete is also 33 seconds.

Here is the config from the service:

<?xml version="1.0"?>
<configuration>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true" >
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="c:\WCFTrace\InstancingDemo.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="SecPerCallBehaviour">
          <serviceThrottling maxConcurrentSessions="1000"
                              maxConcurrentCalls="30"
                              maxConcurrentInstances="30"/>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <bindings>
      <wsHttpBinding>
        <binding name="BindingNoSec">
          <security mode="None" />
        </binding>
        <binding name="BindingMessageSec">
          <security mode="Message">
            <message establishSecurityContext ="true"/>
          </security>
        </binding>
        <binding name="BindingMessageSecPerCall" >
          <security mode="Message">
            <message establishSecurityContext ="true"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service name="ServiceInstancingDemo.Service1">
        <endpoint address="~/Service1.svc"
          binding="wsHttpBinding" bindingConfiguration="BindingNoSec"
          name="NoSecurity" contract="ServiceInstancingDemo.IService1" />
      </service>
      <service name="ServiceInstancingDemo.Service2">
        <endpoint address="~/Service2.svc"
          binding="wsHttpBinding" bindingConfiguration="BindingMessageSec"
          contract="ServiceInstancingDemo.IService2" />
      </service>
      <service name="ServiceInstancingDemo.Service3" behaviorConfiguration="SecPerCallBehaviour">
        <endpoint address="~/Service3.svc"
          binding="wsHttpBinding" bindingConfiguration="BindingMessageSecPerCall"
          contract="ServiceInstancingDemo.IService3" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

And here’s the config from the client:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IService2" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
                    </security>
                </binding>
                <binding name="NoSecurity" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                    transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="None">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true" />
                    </security>
                </binding>
                <binding name="WSHttpBinding_IService3" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://rb-t510/NGCInstancing/Service2.svc/~/Service2.svc"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService2"
                contract="NGCWithSec.IService2" name="WSHttpBinding_IService2">
                <identity>
                    <servicePrincipalName value="host/RB-T510" />
                </identity>
            </endpoint>
            <endpoint address="http://rb-t510/NGCInstancing/Service1.svc/~/Service1.svc"
                binding="wsHttpBinding" bindingConfiguration="NoSecurity"
                contract="NGC.IService1" name="NoSecurity" />
            <endpoint address="http://localhost/NGCInstancing/Service3.svc/~/Service3.svc"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService3"
                contract="NGCSecPerCall.IService3" name="WSHttpBinding_IService3">
                <identity>
                    <servicePrincipalName value="host/RB-T510" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>

I guess that I’m missing a config setting? Or maybe mutiple calls using message security over wsHttp are always going to be very slow because the server object must be instantiated per session and only a single session is created for each client?

Many thanks

Rob.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:29:55+00:00Added an answer on May 26, 2026 at 6:29 am

    The counters you want have to be explicitly enabled in your service:

    <configuration>
        <system.serviceModel>
            <diagnostics performanceCounters="All" />
        </system.serviceModel>
    </configuration>
    

    Obviously it can be more granular too. This is what you want to read: WCF Performance Counters

    Update:
    A better link: How to use performance counters to diagnose performance of WCF applications

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a website that runs on two load balanced servers. We use the
We have a website that runs on two load balanced servers. We used the
I currently have an asp.net website hosted on two web servers that sit behind
I have an Umbraco website that is running on IIS7.5 and is Load Balanced.
I have 3 websites that run from a load-balanced pool of servers. Load-balancer uses
I have about 50 web-sites, load-balanced across 5 web-servers. They all use Enterprise Library
I have a website that I wish to load in a UIWebView, but it
We have a website that uses #include file command to roll info into some
I have a presentation web farm with four load-balanced servers. I have one web
I have a website project that needs to load a 32 bit DLL, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.