I'm hosting RStudio Pro on a linux server. Recently, I've seen intermittent lag when executing commands: every 10th command or so hangs for 5-10 seconds, irrespectively of the command (e.g., it doesn't depend on the compute cost of the command). There's no apparent CPU or memory load on the server.
- What could cause this?
- How could I write R code that would time commands run from the console in RStudio, timing the execution time, but taking console lag time into account? This would allow for monitoring lag while attempting to locate the problem.