There are many reasons why a shiny app runs slower than expected. The most common reason is the Shiny app code has not been optimized. You can use the profvis package to help you understand how R spends its time. You also might want to make sure your server is large enough to host your apps. Both RStudio Connect and Shiny Server Pro have tools that will allow you to support a large number of apps and users.
Here is a list of items to consider when checking your Shiny app performance.
- Check your Shiny application code. Have you optimized your code for performance? Consider using profvis and the Shiny admin dashboard [pro].
- Reduce start up times. How long does it take to initialize an application? Consider increasing the application timeout (app_idle_timeout) so apps stay loaded in memory.
- [Pro] Adjust scaling and performance in Shiny Server Pro. How many connections are sharing the same R process? Use the admin dashboard to evaluate; then make adjustments in the utilization scheduler.
- Increase your server size. Do you have enough memory and compute? Use the admin dashboard [pro] to evaluate latency; then increase your server size if necessary.
- Reduce server contention. Are you sharing the server with other services (e.g., RStudio Workbench, RStudio Server Open Source, proxy servers, or web servers)? If possible dedicate a single server instance to Shiny Server.
- Check your network speeds. Are you getting different performance results from home, office, or VPN? Check your network dashboards.
- Check your data center performance. Have there been any issues with your NOC or cloud provider? Check your system dashboards.
- Check your databases. Are your databases performing and are they transferring data reliably? Check your database dashboards and network connections.