Site icon R-bloggers

The elements of scaling R-based applications with DeployR

[This article was first published on Revolutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

If you want to build an application using R that serves many users simultaneously, you're going to need to be able to run a lot of R sessions simultaneously. If you want R to run in the cloud, you can publish R functions as a Web service (and you can do this directly from R with the azureML package). But if you want to run R on your own server, DeployR (part of Microsoft R Server) provides several tools for scaling R sessions to support the load.

DeployR provides Grid Nodes and Slots to serve R sessions which process pre-published R scripts to support the application. These provide scalability to applications in two ways:

  • Grid Nodes: you add capacity by spinning up new machines (nodes) to perform R calculations
  • Slots: each grid node can run multiple R sessions, to support requests simultaneously

There are also four different kinds of slots, which support different kinds of applications:

  • Authenticated slots, for requests initiated by authenticated users;
  • Anonymous slots, for requests initiated by unauthenticated users (usually configured for limited capacity, to defend against denial-of-service attacks);
  • Asynchronous slots, designed for long-running batch tasks;
  • Mixed mode slots, which can run in any mode and are useful to provide "overflow" capacity to the other slot types.

The DeployR administrator can configure the number of slots available for each type, and the resources (cores, RAM, etc.) available to each slot. If there are no slots of the required type available on one Grid Node, it will be dispatched to another available Grid Node. If all Slots on all Grid Nodes are busy, the request will be queued until it can be served.

For more on grid nodes and slots in DeployR, take a look at the article from the Tiger Team at the link below.

Microsoft R Server Tiger Team: Understanding Grid Nodes and Slots in DeployR

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.