ctmm-initiative / ctmmweb

Web app for analyzing animal tracking data, built upon ctmm R package
http://biology.umd.edu/movement.html
GNU General Public License v3.0
32 stars 21 forks source link

Hosting app in shinyapps.io #19

Closed xhdong-umd closed 7 years ago

xhdong-umd commented 7 years ago

Before we explore the option of hosting the app by ourselves, we can use the service provided in shinyapps.io. The free plan is very limited so we need to at least consider the basic plan $39/month.

Some terms used:

R is single threaded, this means one R process can only handle one request at a time. For simple app, because most operations can be finished within hundreds of ms, one worker can handle multiple users/connections without obvious latency problem. A worker can take 50 connections by default, but the server will start new worker to balance the load after 5% of the limit is reached, if there are quota for new worker.

According to my observation, our app use 200M memory for one worker (the first simple version of app only use 50M). So from memory aspect, 1G instance can have 3-4 worker, 8G instance can have 24 - 32 worker.

So my estimate is:

This is just an optimistic estimate, the real number probably will be lower especially when we want small latency. In the other hand, if we don't have a lot of users modeling at the same time, it may still serve the purpose.

The plan sign up is relatively simple, can be upgrade/downgrade at any time. Though it seemed that there is no discount for academic, and there is no partial refund if cancelled (if downgraded to a lower paid plan, the remaining credit can be kept).

jmcalabrese commented 7 years ago

@xhdong-umd, thanks for looking into that.

You say the plan can be upgraded/downgraded at any time. Does that mean that we could sign up for the basic (paid) plan for one month for testing purposes, and then downgrade to the free plan after that month? Are you sure there are no penalties or additional fees for doing that?

I will look into how we can pay for the basic plan.

xhdong-umd commented 7 years ago

@jmcalabrese I think so. Here is the official guide. You can also sign up a free account to look at the actual page of billing.

All plans are payable by credit card only.

All subscriptions auto-renew at the end of the subscription cycle. If you would to like subscribe for only one month or one year, you will need to cancel your subscription prior to the start of the next cycle.

A detailed PDF invoice is available for download on the Account -> Billing page.

An account can be upgraded or downgraded at any time. To change your plan, visit the dashboard under Account -> Billing, scroll to the Plan section, and select the plan you prefer. Upgrades take effect immediately

If you would like to cancel your paid subscription and return to a free account, you can downgrade to the Free plan within the Account -> Billing page.

Please note that at this time cancellations take effect immediately and the entitlements in the subscription cycle do not continue until the end of the subscription cycle. In addition, there are no partial refunds.

The account can be renamed (which determine how the url will look like, my current url is ctmm.shinyapps.io/appname), or transferred to somebody else. So you can pay for an account then transfer it to me if that make it easier.

xhdong-umd commented 7 years ago

There is not much need to be done here before actual sign up. I think we can sign up the basic plan sometime in August, and reserve several days for testing and adjusting configurations.

I'm closing the issue temporarily now, and I will reopen it later.

xhdong-umd commented 7 years ago

We have signed up for the basic plan.

After some time tuning the app configurations and experimenting, now the hosted app can support several users using the time consuming model fitting feature at the same time.

In theory our plan should support

The actual limit is probably lower than these theoretical numbers.

I tested with 5 different connections using the model fitting at the same time without problem.