Fresh new session for rstudio-server
Asked Answered
L

7

30

I am running rstudio-server on a virtualised (vmware-player) ubuntu machine, and processing lots of data into the ram. I find that after some inactivity that the session suspends the data. The problem is that it takes a VERY long time to resume this session and it is making both the host machine and virtual machine lag very badly.

I just want to kill the session and start a new fresh session of rstudio-server, but so far the only way I have found which does this is to reisub my ubuntu machine. Does anyone know a better solution?

As a side note, I think entering session-timeout-minutes=0 in /etc/rstudio/rsession.conf as per here should fix the problem of the session suspending.

Lafferty answered 12/3, 2013 at 0:51 Comment(5)
Does rstudio.com/ide/docs/server/management help you?Etamine
nope :( there is no command to terminate the session. I have also tried all the commands which I think might help from that page, to no avail.Lafferty
I can't answer my own question, but here is this answer: I finally found [this page], which deals with resetting the rstudio-desktop version. In my home directory, I found the folder ~/.rstudio. I renamed/deleted this folder and this loads a new rstudio-server instance. [this page]: support.rstudio.org/help/kb/troubleshooting/…Lafferty
As far as I know you can answer your own question. I have. I suggest you post an answer with the details of your solution.Hyperbole
Thanks Mark. I can now, there is a 8 hour limit for new users to answer their own questions.Lafferty
K
1

Considering the updates on Rstudio and as it was announced on August 30, 2023, the files are stored in two places:

  • ~/.config/rstudio/: All user settings (Global Options)
  • ~/.local/share/rstudio/: All open files and tabs, as well as active and suspended sessions.

Therefore, you can flush/clear/delete the files of the session by:

  1. kill the active session (or kill all sessions)

    # get the PID
    rstudio-server active-sessions
    
    # kill the specific session
    sudo rstudio-server kill-session 25039  # or whatever the your PID is
    

    or

    sudo rstudio-server kill-all
    
  2. Renaming the session files and add -old (good practice instead of deleting it right-away):

    mv "${HOME}/.local/share/rstudio" "${HOME}/.local/share/rstudio-old"
    
  3. Restarting Rstudio

    sudo rstudio-server restart
    

Now open the Rtsudio in the browser and check if everything works normally. You can then delete the session you marked as -old by the following:

rm -rf "${HOME}/.local/share/rstudio-old"
Kennedy answered 7/11, 2023 at 15:22 Comment(0)
L
43

I found this page, which deals with resetting the rstudio-desktop version. In my home directory, I found the folder ~/.rstudio. I renamed/deleted this folder and this loads a new rstudio-server instance.

In fact, there is a folder called suspended session in the ~/.rstudio folder, which I suspect is the thing where suspended data is stored, so maybe deleting this folder is sufficient?

Lafferty answered 12/3, 2013 at 22:35 Comment(5)
Deleting a folder called suspended session is enough. ThanksHopeh
The suspended session was the problem on my case.Piloting
the link is dead!Jauregui
@Jauregui Thanks, I have updated it with what I think is the new link.Lafferty
This answer is outdated. The folder that stores the sessions is now called ~/.local/share/rstudio/sessions/ as per Matifou's answer.Berlyn
E
8

If there is a directory inside ~/.rstudio/sessions/active/, deleting it (in the way like rm -rf ~/.rstudio/sessions/active/session-*) might be sufficient to solve the problem.

Ego answered 5/2, 2018 at 11:10 Comment(0)
S
3

Note that with newer versions of Rstudio, this folder is now under

~/.local/share/rstudio/sessions/

while in some older versions, it can also be seen in ~/.rstudio-desktop, see documentation page

Sudan answered 20/12, 2021 at 13:39 Comment(0)
C
1

Your question is a while back but after running into this problem a zilion times i found a way to reset the Rstudio Shiny Server session without the need for admin rights on Rstudio Shiny Server:

  • put temporarily as first line in server.r : quit("yes") # FORCE CLOSE OF SESSION server

  • go to the site and it will crash (the session closes straight away)

  • delete or comment out: # quit("yes") # FORCE CLOSE OF SESSION server
  • go to the site and you will have the shiny app with a new session =^)

Works for me and saves a lot of time searching through all kind of system folders or the need to enter a part of the system that you are not allowed to go or needing admin rights on Rstudio Shiny Server.

I hope this helps.

Carmelitacarmelite answered 15/7, 2016 at 9:42 Comment(2)
while this looks to be a very useful hack for users running Shiny on shiny-server, my question is actually about rstudio server edition, not shiny server :)Lafferty
Sorry, i mean running a Shiny app with R studio Server. To get a new session in R studio / R studio server you can just select Restart R in the Session menu (if this is what you mean)Carmelitacarmelite
N
1

I have tried the above solutions which didn't work for me. I tried to kill the rsession which is causing the problem. just run this command to find out pid of user session.
ps -u userid
Find out the pid that is causing the rsession to stall. Kill that process and you're good to go.

Noticeable answered 21/9, 2016 at 4:13 Comment(1)
For me, rsession was not listed in ps, I had to use top to find it and then get the process ID and kill it.Troublesome
K
1

Considering the updates on Rstudio and as it was announced on August 30, 2023, the files are stored in two places:

  • ~/.config/rstudio/: All user settings (Global Options)
  • ~/.local/share/rstudio/: All open files and tabs, as well as active and suspended sessions.

Therefore, you can flush/clear/delete the files of the session by:

  1. kill the active session (or kill all sessions)

    # get the PID
    rstudio-server active-sessions
    
    # kill the specific session
    sudo rstudio-server kill-session 25039  # or whatever the your PID is
    

    or

    sudo rstudio-server kill-all
    
  2. Renaming the session files and add -old (good practice instead of deleting it right-away):

    mv "${HOME}/.local/share/rstudio" "${HOME}/.local/share/rstudio-old"
    
  3. Restarting Rstudio

    sudo rstudio-server restart
    

Now open the Rtsudio in the browser and check if everything works normally. You can then delete the session you marked as -old by the following:

rm -rf "${HOME}/.local/share/rstudio-old"
Kennedy answered 7/11, 2023 at 15:22 Comment(0)
A
0

A quick solution would be to rename ~/.rstudio and reopen the webpage using rstudio url.

Aloise answered 6/1, 2014 at 8:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.