The elements of scaling R-based applications with DeployR

September 8, 2016

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

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. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)