# rtorrent 100% cpu



## gettons (Mar 10, 2011)

Hi all,

I've installed through ports rtorrent (with xmlrpc option). All went fine, apart that when I run rtorrent, it uses 100%. No matter what it is doing (downloading, doing nothing with downloads in the queue or doing nothing with any file in queue). It just takes 100% of cpu all the time, after few seconds it ran.

With the default conf file (all commented) it does not happen, but of course I need to edit that. I am going to put one option at time to see what 's the problem.

The download directory is on zfs raid pool, this might be interesting.


----------



## loop (Mar 10, 2011)

I have an rtorrent installation with XMLRPC and the download directory on ZFS, and I don't see this issue.  Care to post your config file?


----------



## gettons (Mar 10, 2011)

loop said:
			
		

> I have an rtorrent installation with XMLRPC and the download directory on ZFS, and I don't see this issue.  Care to post your config file?



Here is the config file


```
$ grep -v '^#' .rtorrent.rc

max_peers = 60

max_peers_seed = 13

max_uploads = 3

download_rate = 700
upload_rate = 10

directory = /stuff/media/rtorrent_temp/ 

session = /usr/home/gettons/.rtorrentsession/

port_range = 55000-55000

port_random = no

check_hash = yes

encryption = allow_incoming,enable_retry,prefer_plaintext

scgi_port = 127.0.0.1:5000
encoding_list = UTF-8
```

2 different behaviours:

Without scgi_port directive in the config file --> as soon as you try to quit with ^q whithin the CLI or you try to kill it from another console with a TERM kill (kill with no signals) it bumps out using 100%.

With scgi_port directive --> it takes 100% cpu as soon as you fire it up.

Can you try to reproduce this?
I am on FreeBSD 8.2 


Cheers


----------



## gettons (Mar 10, 2011)

Also, I am running the 64bit version of FreeBSD 8.2.


----------



## gettons (Mar 10, 2011)

Just found that, even if I compiled with xmlrpc support, when I start rtorrent, I cannot see the xmlrpc message on the screen, which usually pops out, like this: 
	
	



```
XMLRPC initialized with 517 functions.
```

I got a black screen without the usual rtorrent interface...and the cpu goes up to 100% in seconds.

I tried to install on vmachine 32 bits and it did work flawlessly. I guess there must be a problem with the 64bit ports. I got the option during the installation, but eventually it s not compiled with that option at all.

What I have done is to *make install clean* the port located at /usr/ports/net-p2p/rtorrent

Also, another strange thing is that:


```
Port:   rtorrent-0.8.7
Path:   /usr/ports/net-p2p/rtorrent
Info:   BitTorrent Client written in C++
Maint:  flz@FreeBSD.org
B-deps: ca_root_nss-3.12.9 curl-7.21.3 libsigc++-2.2.8 libtorrent-0.12.7 libwww-5.4.0_4 perl-5.10.1_3 pkg-config-0.25_1 xmlrpc-c-devel-1.25.3
R-deps: ca_root_nss-3.12.9 curl-7.21.3 libsigc++-2.2.8 libtorrent-0.12.7 libwww-5.4.0_4 perl-5.10.1_3 pkg-config-0.25_1 xmlrpc-c-devel-1.25.3
WWW:    http://libtorrent.rakshasa.no/

Port:   rtorrent-devel-0.8.6_1
Path:   /usr/ports/net-p2p/rtorrent-devel
Info:   BitTorrent Client written in C++ (development version)
Maint:  flz@FreeBSD.org
B-deps: ca_root_nss-3.12.9 curl-7.21.3 libsigc++-2.2.8 libtorrent-devel-0.12.6_1 libwww-5.4.0_4 perl-5.10.1_3 pkg-config-0.25_1 xmlrpc-c-devel-1.25.3
R-deps: ca_root_nss-3.12.9 curl-7.21.3 libsigc++-2.2.8 libtorrent-devel-0.12.6_1 libwww-5.4.0_4 perl-5.10.1_3 pkg-config-0.25_1 xmlrpc-c-devel-1.25.3
WWW:    http://libtorrent.rakshasa.no/
```


Looks like they are swapped out...


----------



## gettons (Mar 10, 2011)

Fixed installing this version, which is not the devel one (regardless what the package is called), but the stable.


```
libtorrent-devel-0.12.6_1 BitTorrent Library written in C++ (development version)
rtorrent-devel-0.8.6_1 BitTorrent Client written in C++ (development version)
```


----------



## loop (Mar 11, 2011)

For completeness, here is my .rtorrent.rc file:


```
% grep -v '^#' .rtorrent.rc

directory = /home/loop/Download

session = /home/loop/Download/session

schedule = watch_directory,5,5,load_start=/home/loop/Download/watch/*.torrent

schedule = untied_directory,5,5,stop_untied=

schedule = low_diskspace,5,60,close_low_diskspace=100M

ratio.enable=
ratio.min.set=100
ratio.max.set=200
ratio.upload.set=200M

system.method.set = group.seeding.ratio.command, d.close=, d.erase=

system.method.set_key = event.download.inserted,link1, "create_link=tied,,.started"
system.method.set_key = event.download.inserted,link2,"delete_link=tied,,.stopped"
system.method.set_key = event.download.inserted,link3,"delete_link=tied,,.hashing"
system.method.set_key = event.download.paused,  link1,"delete_link=tied,,.started"
system.method.set_key = event.download.paused,  link2,"create_link=tied,,.stopped"
system.method.set_key = event.download.paused,  link3,"delete_link=tied,,.hashing"
system.method.set_key = event.download.hash_queued, link1,"delete_link=tied,,.started"
system.method.set_key = event.download.hash_queued, link2,"delete_link=tied,,.stopped"
system.method.set_key = event.download.hash_queued, link3,"create_link=tied,,.hashing"
system.method.set_key = event.download.finished, link1,"delete_link=tied,,.started"
system.method.set_key = event.download.finished, link2,"delete_link=tied,,.stopped"
system.method.set_key = event.download.finished, link3,"delete_link=tied,,.hashing"
system.method.set_key = event.download.finished, link4,"create_link=tied,,.finished"
system.method.set_key = event.download.erased,  link4,"delete_link=tied,,.finished"

port_range = 6890-6999

schedule = throttle_1,23:00:00,24:00:00,upload_rate=0
schedule = throttle_2,08:00:00,24:00:00,upload_rate=20

encryption = allow_incoming,try_outgoing,enable_retry,prefer_plaintext

peer_exchange = yes

dht = auto

dht_port = 6998

scgi_local = /home/loop/Download/.socket/scgi.socket
schedule = chmod,0,0,"execute=chmod,777,/home/loop/Download/.socket/scgi.socket"
encoding_list = UTF-8

hash_read_ahead = 8
hash_interval = 10
hash_max_tries = 5
```

I am running rtorrent-devel-0.8.6 and libtorrent-devel-0.12.6_1


----------



## astadtler (Apr 11, 2011)

I just tried this xmlrpc-c is whats causing the cpu usage, also I have cpu throttling on so it may look worse than it really is and 2 cores.  

Rtorrent 8.7

When I had my xmlrpc-c client connect cpu usage was 20-35% with 1 torrent open, when I closed the client it went down to <1%.


----------



## settler (Apr 11, 2011)

I see the same problem after upgrading from STABLE to CURRENT
Installing rtorrent-devel fixed it


----------



## lumen (Jan 15, 2012)

I solved this problem here in this way


----------

