Running multiple MCR - one per process

14 views (last 30 days)
Craig Brown
Craig Brown on 1 Dec 2011
Commented: Alec de Zegher on 23 Feb 2015
We are trying to deploy a resource intensive task via the Matlab Compiler Runtime. The MCR sits on a server and we use Web Services to communicate with it. Our problem is that we may wish to have multiple users perform this task at the same time. I have found what looks like a solution on the following matlab page http://www.mathworks.co.uk/help/toolbox/compiler/example_guide/br9zbie-1.html
---------
Many session scaling issues arise because the MCR is single threaded. A single-threaded application prevents two users from doing work that involves the MCR at the same time. One user must wait for the other to finish before continuing. This wait can prove to be substantial if one user is performing a resource-intensive task while the other is attempting a quick calculation.
To workaround the situation, enable multiple MCRs to service requests as they arrive. Run several MCRs in separate processes; one process per MCR. Using this technique, you can create a separate server process that receives requests, runs the requests against one of the processes, and returns the result.
----------
So how do you set up your server so you can "enable mulitple MCRs to service requests as they arrive"? How do you set up the seperate server porcesses as explained above?
Thanks
Craig

Answers (1)

Titus Edelhofer
Titus Edelhofer on 1 Dec 2011
Hi Craig,
you can achieve this using a Client-Server approach on the server. This is described to some detail in the documentation to Builder JA.
Titus
  4 Comments
Sunny Gupta
Sunny Gupta on 10 Dec 2012
Edited: Sunny Gupta on 10 Dec 2012
Hi Walter, our server system has 12 available cores and 64 GBs of main memory. I would expect little contention from the two Matlab executables. When I run a mouse clicked compiled Matlab exe application and command shell exe application it takes 34 seconds longer and the total CPU usage never gets above 70%. However, I just discovered running concurrently two exe's in a different command shells only added an extra 10 seconds. If you combine your suggestion to limit the cores and run each Matlab executables in a separate shell the solution becomes highly scalable.
Thanks for all your help, Cheers SG
Alec de Zegher
Alec de Zegher on 23 Feb 2015
Sunny, Can you share your solution on how to call these executables next to eachother? Or point me out where there is some documentation on this?

Sign in to comment.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!