Improving performance of the App

34 views
Skip to first unread message

puneeth rao

unread,
Jun 23, 2017, 2:36:41 PM6/23/17
to Shiny - Web Framework for R
Hello,

I have built an app that connects R to Hadoop via ODBC driver and downloads 300K rows.
Currently, it takes 3-4 minutes to kickstart the app.

My need is to handle 6 million rows and reduce the start time significantly.



shinyServer(function(input, output) {
  
  # Filter data based on selections
# Connect to Chandler and load XXXXX

options (encoding = "UTF-8")  
dbConn <- odbcConnect(dsn = "XXXXX",uid="XXXX")
test   <- sqlQuery(dbConn,"select * from XXXX where
                   DateID > DATE_SUB(current_date(), 17) 
                   and DateID < DATE_SUB(current_date(), 1)")

Thanks in Advance.

Ger Inberg

unread,
Jun 24, 2017, 3:59:22 PM6/24/17
to Shiny - Web Framework for R
Have you thought about using Spark? This might be interesting for you https://www.r-bloggers.com/using-apache-sparkr-to-power-shiny-applications-part-i-2/

Joe Cheng

unread,
Jun 24, 2017, 6:37:59 PM6/24/17
to Ger Inberg, Shiny - Web Framework for R
Is it necessary to slurp the entire table subset into memory? Can you do some aggregation in the database, e.g. using dplyr?
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/827ffd71-ba18-47ab-bda8-140447804d28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

puneeth rao

unread,
Jun 24, 2017, 7:13:21 PM6/24/17
to Shiny - Web Framework for R, g.in...@gmail.com
Currently, I have no choice other than loading all the data on R Shiny and then perform the filtering based on the user selection.

Joe Cheng

unread,
Jun 24, 2017, 10:13:52 PM6/24/17
to Shiny - Web Framework for R, puneeth rao, g.in...@gmail.com
You're pretty sure about that? Why is that? Are the filter operations not expressible via dplyr?

Reply all
Reply to author
Forward
0 new messages