I noticed my exit node (tordienet) hovering around 1024 connections open, and checked /proc/<pid>/limits (available on newer kernels) and noticed that the filedescriptor ulimit was at the default 1024, which is likely not a great plan.
I'm using the stock /etc/init.d/tor startup script that came in the tor-0.2.3.12.alpha-tor.0.rh5_7 RPM offered by the YUM repo http://deb.torproject.org/torproject.org/rpm/centos5-experimental. It attempts to set ulimit, but at least at startup on my Centos 5.8 openvz container, there's a soft limit set at 1024 filedescriptors, which requires the -S flag to ulimit to override.
I changed line 87 of /etc/init.d/tor to:
if ulimit -SHn "$MAX_FILEDESCRIPTORS" ; then
And /proc/<pid>/limits shows tor running with the appropriate limits now. Unfortunately, this is likely to get reverted with the next package update.
Is anyone else using the stock RPMs seeing the same behavior?
-- Aaron