timeout setting, or a remedy for a long loading time

6,103 views
Skip to first unread message

Hoon Rhew

unread,
Jan 23, 2014, 4:40:30 PM1/23/14
to shiny-...@googlegroups.com
It looks like shiny's timeout is 60 sec. by default.  I have a long data preparation process which takes about 20 min., and I have an error message before the page is loaded (I believe it's time-out. if I comment out the time consuming process, everything works fine.)

In the manual, I found "app_init_timeout", and I modified defalut.config file as below (added two last lines). But, I still have the same problem.
Any advice?

Many many thanks.


 config file in "/opt/shiny-server/config/default.config"
=======================================
run_as shiny;

auth_passwd_file /etc/shiny-server/passwd;

server {
  listen 3838;

  location / {
    site_dir /srv/shiny-server;
    log_dir /var/log/shiny-server;
    directory_index on;
  }


}

admin 4151 {
  required_user admin;
}

app_init_timeout 1800;
app_idle_timeout 1800;
===========================

Fereshteh Karimeddini

unread,
Jan 23, 2014, 5:26:27 PM1/23/14
to shiny-...@googlegroups.com
Please change your config file as follows: (app_idle_timeout and app_init_timeout should be applied to a "location" or "server" directive. In the following config you see them applied to "location".)

run_as shiny;

auth_passwd_file /etc/shiny-server/passwd;

server {
  listen 3838;

  location / {
    site_dir /srv/shiny-server;
    log_dir /var/log/shiny-server;
    directory_index on;

    app_init_timeout 1800;
    app_idle_timeout 1800;

  }


}

admin 4151 {
  required_user admin;
}


Let us know if continue having problem with this.

Best,
Fereshteh
Message has been deleted

Hoon Rhew

unread,
Jan 29, 2014, 6:52:36 PM1/29/14
to shiny-...@googlegroups.com
That fixed the issue. Many thanks!!!!  = )
Message has been deleted

Roy Francis

unread,
Dec 5, 2015, 8:38:13 PM12/5/15
to Shiny - Web Framework for R
Hi have a config file as follows:

# home directory we find the application in.
run_as :HOME_USER:;

# Define a server that listens of port 3838.
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Allow users to host their own apps in ~/ShinyApps
    user_dirs;

    # Optionally, you can restrict the privilege of hosting Shiny applications
    # only to members of a particular Linux group.
    # members_of shinyUsers;

    app_init_timeout 90;
    app_idle_timeout 10;
  }
}

I am testing if the app times out after 10 secs. But the timeout doesn't seem to work. Any advice?
Thanks,
Roy

Fereshteh Karimeddini

unread,
Dec 8, 2015, 2:03:54 PM12/8/15
to Shiny - Web Framework for R
Roy,

app_idle_timeout is the amount of time the R process will remain after all connections are terminated; it is not the session timeout. 

app_session_timeout controls when application's connection is terminated, but that is only available in Shiny Server Pro. Are you using the open source version?

Fereshteh

Roy Francis

unread,
Dec 18, 2015, 3:15:56 PM12/18/15
to Shiny - Web Framework for R
Hi Fereshteh,
Yes, I am using open source version. I tried app_init_timeout and app_idle_timeout using shiny setup and user directory setup. None of them works. But, like you said, it might be only in the Pro version.
Thanks,
Roy

Fabrice

unread,
Apr 20, 2016, 6:20:37 AM4/20/16
to Shiny - Web Framework for R
Hi, this workaround doesnt work for me.
I have a shiny server at my office and I want to use it at home via VPN.
At office my shiny application start in 15 secondes but at home I have a timeout error after around 20 secondes.
Changing the default.config with app_init_timeout 1800; and app_idle_timeout 1800; have no effect...
Thanx for help

Fereshteh Karimeddini

unread,
Apr 20, 2016, 1:32:18 PM4/20/16
to Shiny - Web Framework for R
Your timeout is mostly likely a network connection timeout. When you set app_init_timeout, that controls the response time from R process and used for situations that your application does a lot of computations before it completely loads. But in your case that doesn't seem to be the issue since you can start it up in your office pretty quickly. You might want to check your VPN settings.

Mahdi Baghbanzadeh

unread,
Sep 14, 2018, 1:12:19 PM9/14/18
to Shiny - Web Framework for R
I have a weird problem with this and it happens only sometimes!
I believe it is due to the size of data and computations because I have similar code with a smaller size of data and it runs well. 
plz help me to overcome the problem.
Reply all
Reply to author
Forward
0 new messages