From 6e7007bfba6ea58e753eb1fa779d2793329cfab4 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 4 Feb 2005 12:25:39 +0000 Subject: [PATCH] Add a snippet to set nice level in etc/default/tor svn:r3558 --- debian/changelog | 3 ++- debian/tor.default | 10 ++++++++++ debian/tor.init | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a5e60129c5..ac017913d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,9 @@ tor (0.1.0.0-alpha-cvs-1) UNRELEASED; urgency=low * Add libevent-dev to build-depends. * Update URL to tor in debian/control and debian/copyright. * Add a snippet to disable epoll in etc/default/tor, commented out. + * Add a snippet to set nice level in etc/default/tor. - -- Peter Palfrader Thu, 3 Feb 2005 12:20:07 +0100 + -- Peter Palfrader Fri, 4 Feb 2005 13:24:47 +0100 tor (0.0.9.4-1) unstable; urgency=low diff --git a/debian/tor.default b/debian/tor.default index 5a3d3e798e..6b72d40c0a 100644 --- a/debian/tor.default +++ b/debian/tor.default @@ -14,6 +14,16 @@ RUN_DAEMON="yes" # MAX_FILEDESCRIPTORS=4096 +# +# If tor is seriously hogging your CPU, taking away too much cycles from +# other system resources, then you can renice tor. See nice(1) for a +# bit more information. Another way to limit the CPU usage of an Onion +# Router is to set a lower BandwidthRate, as CPU usage is mostly a function +# of the amount of traffic flowing through your node. Consult the torrc(5) +# manual page for more information on setting BandwidthRate. +# +# NICE="--nicelevel 5" + # # Sometimes epoll is broken. This happens to be the case on # at least the maintainer's desktop box running Linux 2.6.11-rc1 diff --git a/debian/tor.init b/debian/tor.init index bd32a0dd09..0f1cb36246 100644 --- a/debian/tor.init +++ b/debian/tor.init @@ -11,6 +11,7 @@ DEFAULTSFILE=/etc/default/$NAME WAITFORDAEMON=35 ARGS="" MAX_FILEDESCRIPTORS=4096 +NICE="" test -x $DAEMON || exit 0 @@ -54,6 +55,7 @@ case "$1" in start-stop-daemon --start --quiet --oknodo \ --chuid debian-tor:debian-tor \ --pidfile $TORPID \ + $NICE \ --exec $DAEMON -- $ARGS echo "done." fi