Why WCF service able to process more calls from different processes than from thread

Weazel

Why would WCF services configured with instancing per call and multiple concurrency would perform differently when run with different process and totally differently when called from threads?

I have one application which does distribute data through number of threads and makes calls (don't think that locking occurs in code, will test that again) to WCF service. During test was noticed that increasing number of threads in distribution app does not increase overall performance of wcf processing service, average is about 800 mpm(messages per minute processed) so throughput does not really change BUT if you run second application then average throughput increases to ~1200 mpm.

What am i doing wrong? what have i missed? i can't understand this behavior.

UPDATE #1(answer to questions in comments)

Thanks for such quick responses. Max connections is set to 1000 in config(yes in system.net). Referring to this article wcf Instances and threading max calls should be 16 x number of cores, so i assume if called form ~30 threads on 2 cpu wcf service should accept mostly all of those thread calls?

Does it have anything to do with shared memory? because that's probably the only differences between multiple threads and processes, i think.

Don't have a opportunity to right now to test it with more cpu's or single. Will do when can.

tom redfern

So I think to understand this behavior, you first need to understand how WCF processes calls with per-call instancing. The hint is in the name - Per Call.

Every call any client makes is serviced by a new instance of the service (the exception to this is reentrancy, but this is not important in your scenario).

So, configuring service concurrency makes no practical difference to the service behavior. Regardless of whether the calls are coming from a single, multithreaded client, or multiple clients, the service will behave the same: it will create a service instance per call.

Therefore, the difference in overall system performance must be due to something on the client side. If I had to take a wild guess I would say that the one client is slower than two clients because of the cost associated with context switching which is mitigated (via an unidentified mechanism) by running the client in in two separate processes.

If I am correct then you should be able to get the highest performance per thread by running multiple single-threaded clients, which is a test you could do.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Process forked from WCF Service is becoming idle

From Dev

Why the time taken by a thread is more than the total time taken by a process?

From Dev

Supervisor : Why am I able to run more than 4 processes on a 4 core machine?

From Dev

Pipe inputs from more than 1 process

From Dev

IIS hosted WCF service is not able to start a process

From Dev

Globally catch exceptions thrown from WCF async calls in a background thread

From Dev

Not able to import more than 1 rows from excel in mvc

From Dev

C# - How to invoke WCF callback calls from outside the service

From Dev

Is it OK to wait on a child process from a thread different to the one creating the process?

From Dev

Httpwebrequest from wcf service

From Dev

FileNotFoundException from WCF service

From Dev

.NET AJAX Enabled WCF Service called from a different website

From Dev

Return different Object (List or error class) from WCF service

From Dev

Unable to pipe to or from spawned child process more than once

From Dev

stop subprocess from initiating a process more than once

From Dev

stop subprocess from initiating a process more than once

From Dev

Multiple parallel calls to WCF Service takes longer than single call

From Dev

How can I call a different method than run() from a Thread

From Dev

How can I call a different method than run() from a Thread

From Dev

java - nio: send from different thread than selecting

From Dev

WCF - Using more than one service certificate (due to certificate change)

From Dev

File upload of more than 10000 records into SQL Server with WCF service

From Dev

Why build from Crashlytics has size more than .ipa file?

From Dev

How to unsubscribe from WCF service

From Dev

Execute a JAR from WCF Service

From Dev

How to unsubscribe from WCF service

From Dev

Calling an EXE from a WCF Service

From Dev

Inconsistent response from the WCF service

From Dev

How do stop an alert from showing more than once on repeated calls to a function via AJAX?

Related Related

  1. 1

    Process forked from WCF Service is becoming idle

  2. 2

    Why the time taken by a thread is more than the total time taken by a process?

  3. 3

    Supervisor : Why am I able to run more than 4 processes on a 4 core machine?

  4. 4

    Pipe inputs from more than 1 process

  5. 5

    IIS hosted WCF service is not able to start a process

  6. 6

    Globally catch exceptions thrown from WCF async calls in a background thread

  7. 7

    Not able to import more than 1 rows from excel in mvc

  8. 8

    C# - How to invoke WCF callback calls from outside the service

  9. 9

    Is it OK to wait on a child process from a thread different to the one creating the process?

  10. 10

    Httpwebrequest from wcf service

  11. 11

    FileNotFoundException from WCF service

  12. 12

    .NET AJAX Enabled WCF Service called from a different website

  13. 13

    Return different Object (List or error class) from WCF service

  14. 14

    Unable to pipe to or from spawned child process more than once

  15. 15

    stop subprocess from initiating a process more than once

  16. 16

    stop subprocess from initiating a process more than once

  17. 17

    Multiple parallel calls to WCF Service takes longer than single call

  18. 18

    How can I call a different method than run() from a Thread

  19. 19

    How can I call a different method than run() from a Thread

  20. 20

    java - nio: send from different thread than selecting

  21. 21

    WCF - Using more than one service certificate (due to certificate change)

  22. 22

    File upload of more than 10000 records into SQL Server with WCF service

  23. 23

    Why build from Crashlytics has size more than .ipa file?

  24. 24

    How to unsubscribe from WCF service

  25. 25

    Execute a JAR from WCF Service

  26. 26

    How to unsubscribe from WCF service

  27. 27

    Calling an EXE from a WCF Service

  28. 28

    Inconsistent response from the WCF service

  29. 29

    How do stop an alert from showing more than once on repeated calls to a function via AJAX?

HotTag

Archive