RStudio Desktop slow and laggy when project is on a network drive

rstudio
performance
network

#1

I have found that when I open an RStudio proj that's located on my corporate network, RStudio behaves very erratically and laggy. Creating a new file is slow... anything with git is painfully slow. I've monitored CPU and also network traffic and nothing is getting pegged out. There is hardly any network traffic and typical blips of CPU usage. But it's painful on a network drive. Note that my network drive is > 700 miles away but it's typically very usable. I regularly open large files and copy/save across the wire with other applications.

I've seen in old RStudio support periodic comments about RStudio being slow on a network connection, but nothing recently. Is this something others see?

I recorded a screencast so you all can witness what I'm talking about:

https://www.useloom.com/share/873c8875da824c1e9228cf879943e50f

I'm not sure if this is related, but I've found that R's file commands, file.copy for example are terribly slow across my network. Much more so than file system commands using the same machine. I would not think this would be related, but I thought I'd mention it. Here's a SO question where I illustrate the file system commands.

I am running RStudio Version 1.1.442


#2

We had a similar issue that was reportedly fixed in the latest patch releases of RStudio (which it looks like you do have installed):

Could you also share the network log? In a newly launched RStudio session, try playing around a bit until you run into RStudio sluggishness, and then try pressing Ctrl + `. A screenshot of the longest bars you see in there would be helpful.


#3

Kevin, thanks for nudging me to the network log. I didn't know that existed. seems my long bars are all get_events:

I'm happy to send you a full log, but it seems the forum does not support attaching text files to a message.


#4

Is git any faster for you when you run it on command line? In my experience (mostly NFS) git is just much slower on a networking file systems. There are some tweaks you can try like https://git-scm.com/docs/git-config#git-config-corepreloadIndex.


#5

yep. It's reasonable from the command line. In my example all the files are VERY small because I'm just illustrating the problem. If I tick a box in RStudio to select a file in the git pane, it takes >20 seconds for the little box to tick. And that's not really asking git to do anything, just selecting the file in the UI.


#6

@jdlong In that particular case it is not that simple. When you click on the checkbox in the git pane RStudio runs git commands immediately. For instance if it is a new file I think it runs git add and git status.


#7

yeah that makes total sense. Good point.


#8

Thanks for the extra information! One thing to note is that RStudio (synchronously) runs git status every time an RStudio window gains focus, to ensure that the Git pane is up-to-date. If the attempt to call out to git is slow for some reason, that could definitely be a culprit.

Do you see the same kind of slowness in projects not managed by git?

It might also be useful to use something like procmon to see if RStudio appears to be calling out to a particular child process when this sluggishness occurs (if possible in your environment).

The full event log might not be useful quite yet -- the waiting on get_events likely implies that the rsession process was stuck doing something (or waiting for something); hopefully we'll be able to figure out what that is.

(As an aside, if possible, you might try installing a daily build of RStudio from https://dailies.rstudio.com just to see if the experience is any better.)