Use many brochure markers in combination with a brilliant server

I developed the Shiny-app, in which I use a package of booklets to build a large number of points (~ 25.000) on a geographical background. When I launch the application from R-studio, everything works very well. I have a brilliant server running on the same server. I have deployed several applications on this server without any problems. I deployed the application to a brilliant server to make it accessible to end users.

Problem
 On a brilliant server, it looks like the application has problems with the number of tokens (~ 25.000). The application freezes, I can’t do anything, but restart the application. With fewer points (<10.000) there is no problem.
I could not find this problem anywhere.

Any ideas on what the problem is and how to solve it?

Here is my code that I used to check the problem

shinyServer(function(input, output) {

     # Deel Interactive Map 
     plot_data <- reactive({
          columns <- c("lng",
                       "lat",
                       "perc_gtv");
          dt_installaties[1:input$nr_points,
                          columns,
                          with=FALSE];

     })

     output$map_branche <- renderLeaflet({
          leaflet() %>% 
               setView(lng = 5.5, 
                       lat = 52.5, 
                       zoom = 8) %>%
               addProviderTiles("OpenStreetMap.HOT") 

     })
     # Observer that changes the markers as the nr of points is 
     # being changed
     observe({
          pal <- colorBin(palette = c("red","green"),
                          domain = c(0,200),
                          bins = 7)
          leafletProxy("map_branche",
                       data = plot_data()) %>%
               clearMarkers() %>%
               addCircleMarkers(
                    lng = ~lng, 
                    lat = ~lat,
                    color = ~pal(perc_gtv),
                    fillOpacity = 0.9) 


     })

})



shinyUI(
     fluidPage(
          fluidRow(
               numericInput(
                    "nr_points",
                    label = h4("Points to plot"),
                    value = 5000,
                    min = 1,
                    max = nrow(dt_installaties)

               )
          ),
          mainPanel(
               leafletOutput("map_branche")
          )
     )

)

My configuration

  • Platform
  • : x86_64-redhat-linux-gnu
  • R: 3.2.2 R-studio: 0.98.1103
  • Leaflet: 1.0.0
  • Brilliant: 0.12.2
  • Shiny-server: public / free version
+2
source share

Source: https://habr.com/ru/post/1625360/


All Articles