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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:16:56+00:00 2026-06-15T12:16:56+00:00

I have a .NET 4.5 WCF client app that uses the async/await pattern to

  • 0

I have a .NET 4.5 WCF client app that uses the async/await pattern to make volumes of calls. My development machine is dual-proc with 8gb RAM (production will be 5 CPU with 8gb RAM at Amazon AWS) . The remote WCF service called by my code uses out and ref parameters on a web method that I need. My code instances a proxy client each time, writes any results to a public ConcurrentDictionary, and then returns null.

I ran Perfmon, watching the thread count on the system, and it goes between 28-30. It takes hours for my client to complete the volumes of calls that are made. Yes, hours. The remote service is backed by a big company, they have many servers to receive my WCF calls, so the more calls I can throw at them, the better.

I think that things are actually still happening synchronously, even though the method that makes the WCF call is decorated with “async” because the proxy method cannot have “await”. Is that true?

My code looks like this:

   async private void CallMe()
    {
    Console.WriteLine( DateTime.Now );
    var workTasks = this.AnotherConcurrentDict.Select( oneB => GetData( etcetcetc ).Cast<Task>().ToList();
    await Task.WhenAll( workTasks );
    }


    private async Task<WorkingBits> GetData(etcetcetc)
    {
    var commClient = new RemoteClient();
    var cpResponse = new GetPackage();
    var responseInfo = commClient.GetData( name, password , ref (cpResponse.aproperty), filterid , out cpResponse.Identifiers);
    foreach (var onething in cpResponse.Identifiers)
    { 
        // add to the ConcurrentDictionary
    }
    return null; // I already wrote to the ConcurrentDictionary so no need to return anything

responseInfo is not awaitable beacuse the WCF call has ref and out parameters.

I was thinking that way to speed this up is not to put async/await in this method, but instead create a wrapper method where I can make things await/async, but I am not that is the smartest/safest way to work it.

What is a smart way to get more outbound calls to the service (expand IO completion thread pool, trick calls into running in the background so Task.WhenAll can complete quicker)?

Thanks for all ideas/samples/pointers. I am hitting a bottleneck somewhere.

  • 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-15T12:16:57+00:00Added an answer on June 15, 2026 at 12:16 pm

    1) Make sure you’re really calling it asynchronously, rather than just blocking on the calls. Code samples would help here.
    2) You may need to do this:

    ServicePointManager.DefaultConnectionLimit = 100;

    By default it only allows 2 simultaneous connections to the same server.
    3) Make sure you dispose the proxy object after the call is complete so you’re not tying up resources.

    If you’re doing things asynchronously the threadpool size shouldn’t be a bottleneck. To get a better idea of what kind of problem you’re having, you can use Interlocked.Increment and Interlocked.Decrement to track the number of pending calls and see if it’s being limited somewhere.

    You could also substitute your real call with a call to a very simple method that you know will not have any bottlenecks, to see if the problem is in the client or server.

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

Sidebar

Related Questions

I have a simple ASP.NET web app which uses a WCF Client to talk
I have a simple console app that calls a WCF service over net.tcp and
I have a .Net DLL that I created that implements a WCF client that
I have a WCF service in an ASP.NET AJAX app that is returning json.
It is possible to have WCF Client that connects persistantly using duplex over net.tcp
I am building a .NET 3.5 Winforms app that uses WCF services (wsHttp binding)
I have a client/server app. The server component runs, uses WCF in a 'remoting'
I have a WCF service and a client that uses that service. They use
I have an asp.net web application that makes calls to several WCF services. The
I have a REST service consumed by a .Net WCF client. When an error

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.