Plumber API suspension on R server

We have encountered a recurring problem with a Plumber API due to its suspension.

The specific issue we are facing is the accumulation of tasks in the work queue, leading to delayed processing and potential API suspensions. Upon investigation, we have observed that the API session suspends with the message "session suspend timeout paused: Waiting for event set_computed_theme_colors R is executing." This message serves as the primary clue to the root cause of the problem. I must mention the 'session-timeout-minutes' option in the rsession.conf was set to 0.

To mitigate the work queue accumulation and prevent API suspensions, we have resorted to keeping the session window open 24/7. This workaround has proved effective in reducing the queue backlog. However, it is not an ideal long-term solution as it requires us to remain logged in to the session continuously. Any session logouts result in the API suspension, exacerbating the issue further.

# Version
"2022.07.2+576"


# sessionInfo
R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=es_ES.UTF-8       LC_NUMERIC=C               LC_TIME=es_ES.UTF-8        LC_COLLATE=es_ES.UTF-8     LC_MONETARY=es_ES.UTF-8    LC_MESSAGES=es_ES.UTF-8   
 [7] LC_PAPER=es_ES.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] plumber_1.2.1.9000   rstudioapi_0.13      FNN_1.1.3.2          Metrics_0.1.4        automap_1.1-9        geoR_1.9-2           caret_6.0-90        
 [8] lattice_0.20-45      gstat_2.1-0          httr_1.4.2           data.table_1.14.2    tidygeocoder_1.0.5   log4r_0.4.2          caRtociudad_0.6.3   
[15] CatastRo_0.2.2       geosphere_1.5-14     patchwork_1.1.2.9000 gridExtra_2.3        ggthemes_4.2.4       scales_1.2.1         waffle_1.0.1        
[22] ggpubr_0.4.0         ggrepel_0.9.1        ggsflabel_0.0.1      sf_1.0-12            forcats_0.5.2        stringr_1.4.0        readr_2.1.3         
[29] tibble_3.2.1         tidyverse_1.3.2      base64enc_0.1-3      tidyr_1.2.0          purrr_0.3.4          ggplot2_3.4.1        dplyr_1.0.8         
[36] jsonlite_1.8.3       readxl_1.4.1         mongolite_2.6.2     

loaded via a namespace (and not attached):
  [1] backports_1.4.1      lwgeom_0.2-8         plyr_1.8.6           sp_1.4-6             splines_4.2.2        listenv_0.8.0        digest_0.6.29       
  [8] foreach_1.5.2        htmltools_0.5.5      fansi_1.0.2          magrittr_2.0.3       googlesheets4_1.0.1  tzdb_0.3.0           recipes_0.1.17      
 [15] globals_0.14.0       modelr_0.1.9         gower_1.0.0          extrafont_0.18       xts_0.12.1           extrafontdb_1.0      colorspace_2.0-2    
 [22] rvest_1.0.3          haven_2.5.1          tcltk_4.2.2          crayon_1.5.2         survival_3.4-0       zoo_1.8-9            iterators_1.0.14    
 [29] glue_1.6.2           stars_0.6-0          gtable_0.3.0         gargle_1.2.1         ipred_0.9-12         car_3.1-1            Rttf2pt1_1.3.11     
 [36] future.apply_1.8.1   abind_1.4-5          DBI_1.1.2            rstatix_0.7.0        Rcpp_1.0.10          units_0.8-0          proxy_0.4-26        
 [43] stats4_4.2.2         intervals_0.15.3     lava_1.6.10          webutils_1.1         prodlim_2019.11.13   DT_0.17              htmlwidgets_1.6.2   
 [50] RColorBrewer_1.1-2   ellipsis_0.3.2       reshape_0.8.9        pkgconfig_2.0.3      nnet_7.3-18          dbplyr_2.1.1         utf8_1.2.2          
 [57] tidyselect_1.2.0     rlang_1.1.0          reshape2_1.4.4       later_1.3.0          munsell_0.5.0        cellranger_1.1.0     tools_4.2.2         
 [64] cli_3.6.1            generics_0.1.2       splancs_2.01-43      broom_0.7.12         fastmap_1.1.0        ModelMetrics_1.2.2.2 fs_1.6.2            
 [71] future_1.24.0        nlme_3.1-162         xml2_1.3.3           compiler_4.2.2       curl_4.3.3           e1071_1.7-9          ggsignif_0.6.4      
 [78] reprex_2.0.2         spacetime_1.2-8      stringi_1.7.8        Matrix_1.5-1         classInt_0.4-3       vctrs_0.6.1          pillar_1.9.0        
 [85] lifecycle_1.0.3      httpuv_1.6.5         R6_2.5.1             promises_1.2.0.1     KernSmooth_2.23-20   parallelly_1.30.0    codetools_0.2-19    
 [92] MASS_7.3-58.2        assertthat_0.2.1     withr_2.5.0          swagger_3.33.1       parallel_4.2.2       hms_1.1.1            grid_4.2.2          
 [99] rpart_4.1.19         timeDate_3043.102    class_7.3-21         carData_3.0-5        googledrive_2.0.0    pROC_1.18.0          lubridate_1.8.0

See API deployment document. The way you are doing it is for testing purposes. You should run your API code separately from the main R Server process.

Hosting • plumber (rplumber.io)

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.