Increasing File Handle Limit on macOS
When using RcloneView to process a large number of files (e.g., syncing or copying hundreds of files simultaneously), you may encounter the following error:
Too many open files
This occurs because macOS imposes a limit on the number of file descriptors (file handles) a process can open. By default, this value is often set toΒ 256 or 1024, which may be insufficient for heavy operations.
π How to Check Current Limitsβ
Terminal Command:β
ulimit -n # Current shell session soft limit
launchctl limit maxfiles # System-wide soft and hard limits
π οΈ Recommended Configurationβ
- Soft Limit:Β 65536
- Hard Limit:Β 65536
This configuration supports parallel jobs, mounting remotes, and large sync operations without hitting file descriptor limits.
π Step-by-Step: Permanent Limit Increaseβ
1. Create a LaunchDaemon plist fileβ
Open Terminal and run:
sudo nano /Library/LaunchDaemons/limit.maxfiles.plist
Paste the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>65536</string>
<string>65536</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
2. Set proper permissionsβ
sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist
3. Reboot your Macβ
sudo reboot
4. Confirm the new limitsβ
launchctl limit maxfiles
π Reference Resourcesβ
- Apple Support Community:Β Too many open files
- Example Gist:Β limit.maxfiles.plist configuration
- Blog Guide:Β Hiltmon - Increasing file descriptor ulimit on macOS
For any issues, contact support atΒ rcloneview@bdrive.com.