Running multiple MCR - one per process
조회 수: 8 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Titus Edelhofer
2011년 12월 1일
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
Sunny Gupta
2012년 12월 10일
편집: Sunny Gupta
2012년 12월 10일
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
2015년 2월 23일
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?
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!