Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shinyapps.io settings #2

Closed
lcolladotor opened this issue Feb 27, 2020 · 3 comments
Closed

shinyapps.io settings #2

lcolladotor opened this issue Feb 27, 2020 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@lcolladotor
Copy link
Member

Hi,

Based on the fact that the app loads about 2.5 GB of data into RAM to start off, plus looking at the metrics it seems like the app easily reaches 3GB sometimes even 4GB of RAM per user. I still haven't figured out the best set of settings to use for https://jhubiostatistics.shinyapps.io/spatialLIBD/ based on the documentation at https://docs.rstudio.com/shinyapps.io/applications.html#ApplicationPerformanceTuning and what I see in practice.

> pryr::object_size(sce)
2.08 GB
> pryr::object_size(sce_layer)
34 MB
> pryr::object_size(modeling_results)
20.3 MB
> pryr::object_size(sig_genes)
340 MB

## Total
> pryr::object_size(sce, sce_layer, modeling_results, sig_genes)
2.47 GB

We can run up to 10 instances, each of which can have XX number of R workers, with each R worker powering YY number of connections. Earlier I had XX = 1, YY = 1; however we easily ran into "503 resource unavailable" errors. So I now changed it to XX = 1, YY = 2 and added information on the landing page about how you can run the app locally with spatialLIBD::run_app(). Earlier today with a single instance, I could easily crash sessions (connections) if I opened 2-3 of them. And that's using xxxlarge, 8192 MB instances (the largest ones).

Anyway, if you have ideas of the best set of settings to use, please let me know.

Thanks!
Leo

@lcolladotor lcolladotor added the help wanted Extra attention is needed label Feb 27, 2020
@lcolladotor
Copy link
Member Author

Part of an email I just wrote:

You can also run the app locally with:

## You'll need R 3.6.1 or 3.6.2 with Bioconductor 3.10 (current release)
install.packages('remotes') ## if needed
remotes::install_github('LieberInstitute/spatialLIBD')
spatialLIBD::run_app()

Between that and the potential dockerfile deployment option, maybe we can run it on AWS on a higher memory instance.

I'll email RStudio Support soon. Once I finish setting up my account for that.

@lcolladotor
Copy link
Member Author

Request has been posted at https://support.rstudio.com/hc/en-us/requests/44981. Here's the actual request:

Hi,

We have a shiny app at https://jhubiostatistics.shinyapps.io/spatialLIBD/ that we are having some issues deploying as detailed at #2. Given the memory requirements of the app we are asking if there's a way to increase the number of instances, have larger memory instances or what other options you can help us with.

In more detail, the app requires loading ~2.5 GB of data in RAM to load and from tests we've seen that it can reach about ~4 GB per user. The largest component of the data is a Matrix sparseMatrix object, so it's already in low memory format to begin with (and portions of the matrix are converted to regular vectors for some plotting functions). We have access to the https://jhubiostatistics.shinyapps.io shinyapps.io Professional account, meaning that we can launch 10 xxxlarge (8GB) instances. Currently we set the max workers per instance to 1 with 2 max connections per worker; so 20 total users. We think that's about enough to have all 20 running ok without memory-related crashes (though 2 users could potentially go over 8GB of RAM). We would like to ask if it's possible to either request more xxxlarge instances than the current 10 (potentially 1 R worker & 1 connection per instance to avoid memory issues) as when we tested with 10 instances (1 worker, 1 conn) we quickly ran into 503 error pages.

We anticipate a high volume of users in the coming days as we will post a bioRxiv research pre-print describing the data behind this project. We at LIBD got early access to a new technology and will be the first ones to make this amount of data publicly available. Thus we anticipate quite a bit of interest from the research community in general as well as other R package developers (see the #spatial channel on the Bioconductor Slack workspace https://bioc-community.herokuapp.com/). That is, we anticipate having several dozen to maybe hundred concurrent users in the next few days. As the buzz decreases, then we'll have less concurrent users and eventually our current setup (10 xxxlarge instances, 1 R worker, 1 or 2 conns per worker) might be enough (except when we give present the work at conferences and many people access at the same time). Given that first impressions matter a lot, we would like to avoid as much as possible any 503 errors; or the other potential error (allow more connections but risk out of memory errors being very frequent). We do heavily describe that users can run the app locally simply with:

You'll need R 3.6.1 or 3.6.2 with Bioconductor 3.10 (current release)

install.packages('remotes') ## if needed
remotes::install_github('LieberInstitute/spatialLIBD')
spatialLIBD::run_app()

Thank you very much for your help. And please let us know if there's any information you need from us or how we can help you help us.

The code for the shiny app is publicly available at https://github.com/LieberInstitute/spatialLIBD.

Best,
Leo

Leonardo Collado Torres, Ph. D., Staff Scientist II
Lieber Institute for Brain Development
855 N Wolfe St, Suite 300
Baltimore, MD 21205
Website: http://lcolladotor.github.io

@lcolladotor
Copy link
Member Author

Here are some updates.

So our current plan, as we wait to hear back from RStudio is this one.

Screen Shot 2020-02-27 at 5 50 39 PM

@LieberInstitute LieberInstitute locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant