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 8141313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:27:47+00:00 2026-06-06T12:27:47+00:00

I am working on a performance test which involves several clients bombarding the server

  • 0

I am working on a performance test which involves several clients bombarding the server with 150 requests each, as fast as they can.

The server is constructed from 3 WCF services, one is opened to outside with httpbinding, it talks to 2 other services via net.pipe (IPC). one of the services is in charge of DB connections (SQL server 2008 R2).

This DB connection service uses the following connection string enhancments:

Min Pool Size=20; Max Pool Size=1000; Connection Timeout=20;

and is WCF throttled(like all other WCF services).

I noticed that when I activate 1 client it may take 3 seconds, but when I activate 3 clients it may take 8-9 or more.

I checked with the SQL server profiler to see how many concurrent processes are used, and I saw that only about 8 processes are being used.

So I realized that somewhere in the server the requests get queued instead of concurrently processed.

In order to get to the bottom of it I’ve used a performance profiler (ANTS to be exact) which showed me that about 70% of the time was wasted on “Waiting for synchronization

When I open the call graph I find two things that look strange but I’m not sure what they mean:

  1. System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke is being used in the top of the tree, is that ok for concurrent processing?
  2. All synchronized problems involve some kind of SQL Server activity, like ExecuteNonQuery, ExecuteReader and so on (When I get to the bottom of the call tree)

I noticed that the DB connection service uses a DAL project(some legacy code, unfortunately) which is totally static.

After reading this I’m not sure if DAL’s code is problematic or not, here is a sample of a stored procedure call.

    public static int PerformStoredProcedure(string storedP,string ext,out string msg)
    {
        msg = "";
        SqlCommand command = GetSqlCommand(storedP,ext);
        command.Connection.Open();
        int result = (int)PerformStoredProcedure(command,out msg);
        command.Connection.Close();
        return result;
    }

This Method is usualy called from the DB connection service:

    public static int PerformStoredProcedureWithParams(string storedP,string ext,out string msg, params object[] pars)
    {
        msg = "";
        SqlCommand command = GetSqlCommand(storedP,ext);
        UpdateCommandParams(command, pars);
        command.Connection.Open();
        int result = (int)PerformStoredProcedure(command,out msg);
        command.Connection.Close();
        return result;
    }

So, is there anything wrong here?

Or maybe I should look somewhere else?

Edit:

After Brijesh’s comment I realized I hadn’t change the default InstanceContextMode and ConcurrencyMode of the WCF services… Kind of beginner’s mistake I guess.

I’m still not certain if I should use PerSession/Multiple or PerCall/ Single. As I see it each service should handle each request as on object, regardless of the client.

What should I use?

2nd EDIT:

After using PerCall and PerSession/Multiple, I noticed that there is still no change (at least in the DB service). what I see is that the main entry point service may open up alot of threads, but only a few (still around 8-10 threads) are opened at the DB connection service.

is there any other reason why this can happen? I ruled out DAL being a problem because not enough requests go in the DB service so I figure its something in the service or something in the clients…

3rd EDIT:

Here are the config files:

Manager’s config wcf service section:

<services>
  <service behaviorConfiguration="ServicesBehavior" name="Verifone.GenericPP.GPPManagerService.GPPManagerServiceImpl">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:9090/GPPManagerService/"/>
      </baseAddresses>
    </host>
    <endpoint contract="Verifone.GenericPP.GPPManagerService.IGPPManagerService"  binding="basicHttpBinding" address="GPPManagerService"></endpoint>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServicesBehavior">
      <!--amith 13-05-2012-->
      <serviceThrottling
        maxConcurrentCalls="1000"
        maxConcurrentSessions="1000"
        maxConcurrentInstances="1000"
      />
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <basicHttpBinding>
    <binding name="basicHttpBinding" maxBufferSize="10000000" maxReceivedMessageSize="10000000">
      <readerQuotas maxStringContentLength="10000000" maxArrayLength="10000000"/>
      <security mode="None">
        <transport clientCredentialType="None"/>
      </security>
    </binding>

Manager’s clients:

      <endpoint name="endpoint1" contract="IDBConnectionContract"  bindingConfiguration="basicHttpBinding"  binding="basicHttpBinding" address="http://localhost:9010/DBConnectionService/DBService"></endpoint>
  <endpoint name="endpoint2" contract="IGPPService"  bindingConfiguration="basicHttpBinding"  binding="basicHttpBinding" address="http://localhost:9095/GenericPPService/GenericPPService"></endpoint>

DB Connection Service:

<service behaviorConfiguration="ServicesBehavior" name="Verifone.DBConnectionService.DBConnectionContracImpl">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:9010/DBConnectionService/"/>
        <add baseAddress="net.pipe://localhost/DBConnectionService/"/>
      </baseAddresses>
    </host>
    <endpoint contract="Verifone.DBConnectionService.IDBConnectionContract"  binding="basicHttpBinding" address="DBService"></endpoint>

    <endpoint contract="Verifone.DBConnectionService.IDBConnectionContract"  binding="netNamedPipeBinding"  bindingConfiguration="NetNamedPipeBinding_Configuration"  address="" name="pipeEndpoint"/>
  </service>

The business logic service’s client is pretty much the same like the Manager’s.

All services are self hosted and I have a DBConnectionProxy class at Manager’s and Business code which they activate like this:

 DBConnectionContractClient _dbConnectionContractClient = null;
        try
        {
            objDBConnectionContractClient = new DBConnectionContractClient();
            objDBConnectionContractClient.ExecuteStoredProcedure(input, out result);
        }
  • 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-06-06T12:27:50+00:00Added an answer on June 6, 2026 at 12:27 pm

    PerCall You may consider this instancing mode in these circumstances.

    • If your service is stateless

    • If your service has light-weight initialization code (or none at
      all).

    • If your service is single threaded.

    Some good tutorials. See the third link on tuning.

    WCF Instancing, Concurrency, and Throttling – Part 1

    WCF Instancing, Concurrency, and Throttling – Part 2

    WCF Instancing, Concurrency, and Throttling – Part 3

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

Sidebar

Related Questions

I'm working on watin script which read forms on e-shop. In this test I
I'm currently working on creating an environment to test performance of an app; I'm
How much does the garbage collector affect performance when working with lots of objects
I am working on a MVC project and the performance was fine. On application_start
A project I'm working on is suffering from some minor performance issues. Our team
I've been working on improving my OpenGL ES 2.0 render performance by introducing batching;
I have a performance problem related to string comparison (in Java). I'm working on
I want to start working on a big project. I research about performance issues
I am working on image processing library in c#. want to improve performance/speed and
I am working on a Java project where I have an ant build, which

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.