I have deployed an app on shiny.io that uses the function below to do some computations in parallel. It computes a proportion value from the data (df
) for each unique combination of thresh1
and thresh2
. I then call future::plan(multisession, workers = 4)
in the server code prior to calling the function.
get_sensitivity <- function(df, thresh1=c(1:25), thresh2=c(1:52)) {
sensitivity <- tidyr::expand_grid(thresh1, thresh2) |>
(\(z) dplyr::bind_rows(
furrr::future_map2(
z[[1]], z[[2]],
~get_props(df, .x, .y)
)
))()
return(sensitivity)
}
On my machine (Apple M2 16GB memory, 8 cores), the computations complete with the default params (1300 calculations) in ~6 seconds. In the deployed app, it takes > 80 seconds to complete (with just 1 user). Is there a setting I need to tweak to allow these computations to run in parallel in the deployed app?
I am on a Pro account and these are the settings (mostly the defaults).