Troubleshooting ‘Too Many Open Files’ on Posit Workbench
Resolving ulimit issues on Posit Workbench
Description
Problem
You may see errors similar to the below when using Posit Workbench:
[rsession-<username>] ERROR system error 24 (Too many open files)Note that <username> here is the username of the affected session. This type of error message usually relates to the underlying Linux server, and indicates that your operating system has reached its limit on the number of files that can be open at one time. When an error message points out a particular session as above, this means that the issue only affects a single user rather than the system as a whole.
Solution
lsof can be used to see what processes are using a large number of file descriptors.
Alternatively, increase the limit on the number of open files for the affected user by updating the configuration in /etc/rstudio/rsession-profile:
/etc/rstudio/rsession-profile
ulimit -n 4096/etc/rstudio/rsession-profile requires 755 permissions. Set the needed permissions:
Terminal
chmod 755 /etc/rstudio/rsession-profileSave the above file, and then restart the RStudio service:
Terminal
sudo rstudio-server restartOnce the R session has restarted, you should now see this value in effect by running the following commands in the R terminal:
R Console
system("ulimit -n")or
R Console
system("ulimit -a")Note that you may need to increase the ulimit value above to more than 4096 if you are still seeing the issue!