#728 [Debian] Meaningful defaults for MAXFDS

Reporter t2d2
Owner Nobody
Stars ★ (1)
  • Status-New
  • Priority-Medium
  • Type-Enhancement
  1. t2d2 on

    I believe the init script should have meaningful defaults concerning the maximum file descriptors. This is especially important, when using the standard file backend. I propose the logic of the tor daemon: ``` # Let's try to figure our some sane defaults: if [ -r /proc/sys/fs/file-max ]; then system_max=`cat /proc/sys/fs/file-max` if [ "$system_max" -gt "80000" ] ; then MAX_FILEDESCRIPTORS=32768 elif [ "$system_max" -gt "40000" ] ; then MAX_FILEDESCRIPTORS=16384 elif [ "$system_max" -gt "10000" ] ; then MAX_FILEDESCRIPTORS=8192 else MAX_FILEDESCRIPTORS=1024 cat << EOF Warning: Your system has very few filedescriptors available in total. Maybe you should try raising that by adding 'fs.file-max=100000' to your /etc/sysctl.conf file. Feel free to pick any number that you deem appropriate. Then run 'sysctl -p'. See /proc/sys/fs/file-max for the current value, and file-nr in the same directory for how many of those are used at the moment. EOF fi else MAX_FILEDESCRIPTORS=8192 fi ```

New comment

Not published. Used for spam prevention and optional update notifications.