none
Invoking a callback method (WCF netTcp) inside a loop RRS feed

  • Question

  • I call a service method with callback from a loop. But if I call it for more than say 10 times before receiving any callback, the service throws an exception. So what I have implemented is that keeping a flag and resetting it upon callback and then again calling the service method. But this got equivallent to a normal method call and I am not getting the performance enhancement.

    I shall request the experts here to advise me to solve the issue.

    Regards,
    Kangkan
    Kangkan
    Thursday, August 13, 2009 5:35 PM

Answers

  • Hi Kangkan,
       I guess that ,It was a error which caused by your service Throttling.
       So Please try to add the following codes in  your WCF service configration file: 
       serviceBehaviors>
            
    <behavior name="WCFService.WCFServiceBehavior">
              
    <serviceTimeouts transactionTimeout="00:01:00"/>
              
    <serviceMetadata httpGetEnabled="true" />
              
    <serviceDebug includeExceptionDetailInFaults="false" />
              
    <serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000"/>-->
            
    </behavior>
          
    </serviceBehaviors>

    for the default connections value is 10.
     Regards

    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    Tuesday, August 18, 2009 9:30 AM
  • what is your maxConcurrentCalls on your service throttling behavior on your server?
    http://blogs.msdn.com/sajay
    Monday, August 17, 2009 6:32 PM
    Moderator

All replies

  • Hi Kangkan,

    Please let us see how you define the service and how you call the service operations in client application. I want to know how you call a service method with callback from a loop. Also post the detailed description about that exception. Commonly Concurrency and Instancing are related to performance improvement. Please let me know how you get performance enhancement via invoking a callbace method inside a loop. Also note that there is one property maxConnections in netTcpBinding Binding properties. It specifies the maximum number of outbound 10 or inbound connections. Outbound and inbound connections are counted separately. The default value is 10. You can set this property to fix this issue.

    Hope this helps,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, August 17, 2009 1:45 AM
    Moderator
  • what is your maxConcurrentCalls on your service throttling behavior on your server?
    http://blogs.msdn.com/sajay
    Monday, August 17, 2009 6:32 PM
    Moderator
  • Hi Kangkan,
       I guess that ,It was a error which caused by your service Throttling.
       So Please try to add the following codes in  your WCF service configration file: 
       serviceBehaviors>
            
    <behavior name="WCFService.WCFServiceBehavior">
              
    <serviceTimeouts transactionTimeout="00:01:00"/>
              
    <serviceMetadata httpGetEnabled="true" />
              
    <serviceDebug includeExceptionDetailInFaults="false" />
              
    <serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000"/>-->
            
    </behavior>
          
    </serviceBehaviors>

    for the default connections value is 10.
     Regards

    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    Tuesday, August 18, 2009 9:30 AM
  • I basically call up a service that provides me with some data. Say some details of different kind of transactions of a consumer over a period of time. I need to call the service for, say 25000 consumers. In such a case, calling up the service to return all the data in a single go, I felt is not a good idea. This is so because, thedata size for a sing customer itself is actually a collection and that include collections inside collection. This means the data is hierarchic. So, I tried to call up the service once for each customer. The TAT of the service is also in the order of seconds and as data volume is high, we implemented it using asynchronous callback service that sends the data in blocks and turns a flag true once the last block is sent.

    On each block completion event, the client checks for the block_complete flag. If the flag is set to true, the client queues the customer data to some analysing code to process the data further.

    The issue is that if I call the service from the loop continuosly, the service become unresponsive after some time (say after 15 calls).

    That is where I came to this forum.

    I shall provide you more details of the configuration details shortly.

    Regards,
    Kangkan
    Kangkan
    Tuesday, August 18, 2009 5:08 PM
  • I shall like to ask you, the experts, for one more situation.

    For some analysis, I need to pull a large set of data (say a collection of dictionary objects or collection of collection). The set is of around 3000 rows of data for each of say 25000 items. The data is stored in some fashion and there is some business logic also to return the data. Should I go for a service (WCF) to return this large data or should I get it implemented as an in-proc DLL? Services (WCF) suffer from the limit in data volume and I feel there will be management issue of the service contexts in this scenario. But WCF services will provide me the scalability factor and the decoupled design.

    I shall like to have your views for the same.

    Thanks and regards,
    Kangkan
    http://www.geekays.net/
    Kangkan
    Thursday, August 20, 2009 5:06 PM