I have a debian 7.8 server, running on OpenVZ. On this server I'm running a tor relay and some other network services (like apache and mysql). However the tor service seems to eat up all my available TCP sockets.
According to the Parallels Control panel between 358 to 360 TCP connections are open (at a hard limit of 360 connections). lsof -i
and netstat
reveal that nearly all of the connections are used by tor and that they are not in a TIME_WAIT
state.
I'd like to also use other network services, but most of the time I'm getting error messages. I cannot even install packages via apt-get when tor is running. So I need more free TCP connections.
As I said the server is virtualized by OpenVZ and thus changing any TCP settings via sysctl isn't possible. I guess I have to limit the number of TCP connections of tor process. But how do I do that? The torrc
doesn't seem to provide any option for that. Can I use iptables
for this task and how? If not, are there other solutions?
EDIT: Just to eliminate misunderstandings: I do not run the OpenVZ server. Actually my debian server is hosted by 1and1. It seems that numtcpsock=360 is limited by the hoster.