Posit Workbench (previously RStudio Server Pro) gives you the ability to load balance by to add your own custom load balancing script to make load balancing decisions, in addition to more prescribed methods. Specifics can be found in the Posit Workbench admin guide.
Please use the configuration and script location given in the admin guide above.
The example below load balances by randomly selecting an RStudio node for each new session:
#!/usr/bin/env bash # Assuming input is comma-separated, no spaces # RSTUDIO_NODES="10.1.1.10:8787,10.1.1.11:8787,10.1.1.12:8787" # reads node list into an array IFS=',' read -r -a RSTUDIO_NODES_ARRAY <<< "$RSTUDIO_NODES" # selects random node from array and returns it to stdout echo "${RSTUDIO_NODES_ARRAY[$RANDOM % ${#RSTUDIO_NODES_ARRAY[@]}]}"
Comments