none
WCF Serice - Performance testing with jMeter RRS feed

  • Question

  • Hi,

    I have developed a RESTful WCF service (WebHttpBinding). I ran a performance test using jMeter. The test plan contained one operation in the service, which will be called in 100 concurrent threads. However, I noticed that after running the test, the first 20 to 30 threads are taking considerable amount of time to get the response (say 10-15 seconds) and then all the other remaining threads will complete their execution in 2-3 seconds. It seems to me as if the first few threads are blocking the threads that reach the server after them.

    My service have the below configurations:

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]

    And also,

    <serviceThrottling maxConcurrentCalls="300" maxConcurrentSessions="300"/>

    Could someone please give some pointers as to what is causing this initial delay?


    • Edited by tjosephp Tuesday, July 31, 2012 2:50 PM
    Tuesday, July 31, 2012 1:11 PM

All replies

  • When you have Concurrency Mode set to Multiple your operation are not thread safe. So if your service using the same resources you have a chance you run into RACE CONDITION or DEAD LOCK. Have you placed any synchronization mechanism to make your call thread safe. And are you calling the same method again and again ... or doing different things.

    Sometimes, WCF services takes a bit long at the start up. To WARM Up in the server and doing instantiation and channeling stuff, but it should be consistent after 1-2 calls.


    Tanvir Huda Application Architect/Consultant http://thetechnocrate.wordpress.com/

    Wednesday, August 1, 2012 1:50 AM
  • Hi Tanvir,

    Thanks for your reply.
    The operation that I am trying to do involves only reading the data (this includes reading from AppFabric Cache also) - no updates. I am calling the same method again and again - not doing anything different. No lock keyword, or anyother synchronization mechanisms are used in this. If I run the test for 200 concurrent users and 50 iterations (10000 requests), I see that the service gives a very slow response for the first 1000 requests, and then it completes quickly.

    Thanks!

    Wednesday, August 1, 2012 6:03 AM
  • Hi RajeshJoseph,

    I agreed Tanvir's opinion.

    I suggest you to try two more ways to test your WCF Service.

    1.Run the test for 300 concurrent users and 100 iterations (30000 requests) and see whether the number will grow.

    If it is still be 1000 requests, I think it is caused by warming up the WCF service.

    2.As you mention that you are reading the data. I suggest you to increase and reduce the amount of data to see whether the slow requests number will change.

    Wednesday, August 1, 2012 11:02 AM
  • Hi All,

    Thanks for your replies.

    I found that the delay hapens when I try to retrieve data from AppFabric Cache (the WCF service is an AppFabric Client). So, I have posted a question in the AppFabric Cache forum. Please find the link below:

    http://social.msdn.microsoft.com/Forums/en-US/velocity/thread/d66ef1b7-4324-482f-8189-08ce86643df4

    I would appreciate if someone could give me some helpful pointers.

    Thanks again!

    Thursday, August 2, 2012 8:14 AM
  • HI RaieshJoseph,

    I'm not familiar with AppFabric Cache.(Just a guess: Maybe it needs time to be ready for cache? )

    I suggest you to wait for the reply.

    Friday, August 3, 2012 2:34 AM
  • It is recommended to host AppFabric separately from your WebServer. Becuase app fabric itself is bit resource hungry. I am just wondering whether you are hitting the hardware limit... how much Ram you have in your development machine and what you are running on it.


    Tanvir Huda Application Architect/Consultant http://thetechnocrate.wordpress.com/

    Friday, August 3, 2012 4:01 AM
  • Hi Tanvir,

    The system has the below configuration:

    Processor: 2 processors, Intel Xeon 2.53 GHz

    Memory: 8 RAM

    OS: Windows 2008 standard 64 bit OS.

    Hard Disk: 40 GB free

    I have the WCF service, and the AppFabric Caching Service running on the same server (some other softwares are also there). However, whenever I run the test, at no point in time I see the memory crosses 4 GB mark.

    Friday, August 3, 2012 9:59 AM