On Tue, 5 Apr 2011 14:56:42 +0200 Gijs Peskens gpeskens85@gmail.com wrote:
I'm running an exit relay configured to give up to 6,4MB/s on an Athlon64 3000+ Freebsd box, and I'm seeing cpu usage between 30-60% is this considered normal ? Any means of getting it down? (except getting a faster
For such a high-throughput node on such an old CPU, yes, that is not only normal, but actually quite low CPU usage.
cpu or hardware crypto)
I don't remember whether the 3000+ is a K10-type CPU or later. If it is, then make sure you have superpages support enabled in your kernel at boot time. If the 3000+ is pre-K10, then enabling superpages support is as likely to hurt performance as it is to help it, which basically would leave you the option of trying it both ways to see which worked better for you. On a K10 or later style of CPU, running a high-throughput node with superpages enabled should shave 10% to 30% from whatever tor's current usage. IOW, if you're seeing 30% - 60% now, then what you see with superpages enabled would probably fall into the 21% - 54% range. The problem with AMD's pre-K10 CPUs is that the size of the TLB shrinks when 4 MB pages are used, so that instead of having 64 entries for text pages and 64 entries for data/stack pages, there are only two (maybe just one--I don't recall for sure) entries for each. Because tor is a much larger process than would fit into one 4 MB page of each kind, using the 4 MB page size instead of the 4 KB page size is very likely to drastically increase the frequency of full address translations, rather than reducing it as on later CPUs in which the TLB retains the capacity for both page sizes. To enable the use of superpages, your system must be at 7.2-RELEASE or later of FreeBSD. Just add the following to /boot/loader.conf, and then reboot.
# enable superpages (4 MB) for large processes vm.pmap.pg_ps_enabled=1
Scott Bennett, Comm. ASMELG, CFIAG ********************************************************************** * Internet: bennett at cs.niu.edu * *--------------------------------------------------------------------* * "A well regulated and disciplined militia, is at all times a good * * objection to the introduction of that bane of all free governments * * -- a standing army." * * -- Gov. John Hancock, New York Journal, 28 January 1790 * **********************************************************************