Shiny 正常退出,代码 137,信号 9 (SIGKILL) [英] Shiny exited normally with code 137, signal 9 (SIGKILL)

查看:54
本文介绍了Shiny 正常退出,代码 137,信号 9 (SIGKILL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Shiny 应用程序部署到 Shinyapps.io,但我遇到了以下消息:正常退出,代码 137,信号 9 (SIGKILL)".该应用在本地运行良好,加载时间不到 1 分钟.

I'm trying to deploy a Shiny app to shinyapps.io and i'm coming across the message: "exited normally with code 137, signal 9 (SIGKILL)". The app runs fine locally and takes under 1 minute to load.

我认为这是由于我作为捆绑包的一部分上传的一些文件的大小,它们超过 1Gb 而我被限制为 1Gb(根据这个 post).所以我在代码中更改了这一点(在压缩重文件后,使总大小低于 1Gb 限制)

I thought this was coming from the size of some files i'm uploading as part of the bundle, they are over 1Gb and i'm limited to 1Gb (as per this post). So i changed this bit in the code (after zipping the heavy files, making the total size way below the 1Gb limit)

files <- list.files('dpe/', pattern = "csv")
dpe <- data.frame()
for (i in files) {
    current_DF <- fread(paste0("dpe/",i))
    current_DF$date_arrete_tarifs_energies <- as.IDate(current_DF$date_arrete_tarifs_energies)
    dpe <- rbind(dpe,current_DF)
}
rm(current_DF)

为此:

unzip("dpe/Archive.zip")
files <- list.files(pattern = "csv") 
dpe <- data.frame()
for (i in files) {
    current_DF <- fread(i)
    current_DF$date_arrete_tarifs_energies <- as.IDate(current_DF$date_arrete_tarifs_energies)
    dpe <- rbind(dpe,current_DF)
}
rm(current_DF)

注意:显然,解压缩时,文件最终位于应用程序的根文件夹中(链接)

Note: apparently, when unzipping, the files end up in the root folder of the app (link)

我仍然收到相同的错误消息...我不确定我是否正确解释了此消息.有什么想法吗?我有哪些选择?

I still get the same error message... I'm not sure i'm interpreting this message correctly. Any thoughts? What are my options?

推荐答案

我遇到了完全相同的问题,其中一个解决方案确实是购买付费计划并增加实例大小"在设置"中Shiny App 通用仪表板的选项卡(或通过 rsconnect::configureApp() 中的size"参数手动指示).

I had the exact same issue and one of the solutions was indeed to buy a paid plan and increasing the "Instance Size" in the "Settings" tab of the Shiny App general dashboard (or indicating it manually through the "size" argument in rsconnect::configureApp()).

但是,我也通过在 R 中加载我使用的所有 CSV、XLSX 文件,然后使用 saveRDS() 将它们保存为 RDS 文件来解决这个问题.然后,您可以使用 readRDS() 加载它们.这不会减少 R 中的内存,但会大大减少文件的大小(在我的情况下几乎减少了三分之一),使您能够低于包大小限制并能够使用 Shiny Apps 的免费付费计划进行部署.

However, I also solved this issue by loading in R all CSV, XLSX files I was using, and then saving them as RDS files with saveRDS(). Then, you can load them with readRDS(). This will not reduce memory within R, but will substantially reduce the size of your files (in my case by almost one-third), allowing you to be below the bundle size limit and able to deploy with the free paid plan of Shiny Apps.

既然您提到文件最终位于应用程序的根文件夹中,这可能对您有所帮助,就像在我的情况下一样.

Since you mentioned that the files end up in the root folder of the app, this may help you as it did in my case.

这篇关于Shiny 正常退出,代码 137,信号 9 (SIGKILL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆