TUNING 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Most operating systems limit an amount of TCP sockets that can be used
  2. simultaneously. It is possible for a busy Tor relay to run into these
  3. limits, thus being unable to fully utilize the bandwidth resources it
  4. has at its disposal. Following system-specific tips might be helpful
  5. to alleviate the aforementioned problem.
  6. Linux
  7. -----
  8. Use 'ulimit -n' to raise an allowed number of file descriptors to be
  9. opened on your host at the same time.
  10. FreeBSD
  11. -------
  12. Tune the followind sysctl(8) variables:
  13. * kern.maxfiles - maximum allowed file descriptors (for entire system)
  14. * kern.maxfilesperproc - maximum file descriptors one process is allowed
  15. to use
  16. * kern.ipc.maxsockets - overall maximum numbers of sockets for entire
  17. system
  18. * kern.ipc.somaxconn - size of listen queue for incoming TCP connections
  19. for entire system
  20. See also:
  21. * https://www.freebsd.org/doc/handbook/configtuning-kernel-limits.html
  22. * https://wiki.freebsd.org/NetworkPerformanceTuning
  23. Mac OS X
  24. --------
  25. Since Mac OS X is BSD-based system, most of the above hold for OS X as well.
  26. However, launchd(8) is known to modify kern.maxfiles and kern.maxfilesperproc
  27. when it launches tor service (see launchd.plist(5) manpage). Also,
  28. kern.ipc.maxsockets is determined dynamically by the system and thus is
  29. read-only on OS X.
  30. Disclaimer
  31. ----------
  32. Do note that this document is a draft and above information may be
  33. technically incorrect and/or incomplete. If so, please open a ticket
  34. on https://trac.torproject.org or post to tor-relays mailing list.
  35. Are you running a busy Tor relay? Let us know how you are solving
  36. the out-of-sockets problem on your system.