rutorrent load issue - autotools

saroos1

Member
May 25, 2018
718
0
16
Hey,

After a few days of investigating high load on servers running ruTorrent that I set up, I think I found the problem.

Details:
XenServer Host, below was in the VMs.
rTorrent 8.6 (Discovered with 8.8, research done with 8.6)
libTorrent 12.6 (Discovered with 12.8, research done with 12.6)
XMLRPC-C Latest SVN
ruTorrent Latest SVN
ruTorrent Plugins Latest SVN
Debian 6 - 2.6.32-5-amd64
lighttpd + FastCGI w/ php5-cgi (All from repos)

Issue:
When adding a torrent, load on my 3 core 3GB RAM VM would jump to around 40%. Even without the torrent downloading, adding it paused caused the load to go to 40%. Load was under %sy and %us mainly.

The temporary solution was "killall php5-cgi", this would drop the load back to around 0% for the idle rtorrent/server. If I added another torrent (watch dir or through rutorrent) the load would again increase to 40% and stay there, but not until I added another torrent.
The load did not go down over time. A friend's server that I was testing on had been running for 3 days at 40% load with 1 torrent in rTorrent.

A strange part is that none of the processes in "top" will be using a large percentage of cpu, the php5-cgi process will appear to be using only 1% of the cpu, but the total usage is 40% and nothing else is using it.

Here is an example after adding 1 torrent, the torrent was added stopped.
Cpu(s): 12.6%us, 16.7%sy, 0.0%ni, 67.9%id, 1.4%wa, 0.0%hi, 0.2%si, 1.2%st
And here is after running "killall php5-cgi".
Cpu(s): 0.9%us, 0.7%sy, 0.0%ni, 97.2%id, 0.9%wa, 0.0%hi, 0.0%si, 0.1%st

Research:
I thought it might be my dedicated server, so I got a new one that had VT support, and new (to me) everything else. Issue was still there. Reinstalled XenServer multiple times for testing, also reinstalled the Debian VMs many many times.

Tried different versions of libtorrent and rtorrent too.

Some of the behaivor pointed me to the plugins, so I just deleted everything in rutorrent/plugins, after doing this adding torrents no longer created the load. After some trials I narrowed it down to autotools. After removing autotools I get this after adding a torrent:
Cpu(s): 0.4%us, 0.2%sy, 0.0%ni, 97.6%id, 1.7%wa, 0.0%hi, 0.1%si, 0.1%st

Final Thoughts:
I'll submit this as an issue in a little while, but I'm doing a little more research before I do that. (I read the forum rules.)

Posting here in case there are others experiencing this.
 

simur612

Member
May 25, 2018
879
0
16
More research:

label.php of autotools looks to be the problem.

1000 23082 0.0 0.3 108448 9004 pts/1 R+ 14:42 0:00 /usr/bin/php5-cgi label.php --daemon

It is constantly changing PIDs and spawning itself:

root@Deb6Files:/var/log# ps aux | grep php5-cgi | grep -v grep
1000 28593 3.0 0.2 72108 8264 pts/1 R+ 14:43 0:00 /usr/bin/php5-cgi label.php --daemon
1000 28598 0.0 0.1 92340 4340 pts/1 R+ 14:43 0:00 /usr/bin/php5-cgi label.php --daemon


More evidence:
Cpu(s): 14.3%us, 15.7%sy, 0.0%ni, 65.6%id, 3.0%wa, 0.0%hi, 0.3%si, 1.2%st
root@Deb6Files:/var/log# ps aux | grep php5-cgi | grep -v grep
1000 22626 0.0 0.2 107900 8412 pts/1 R+ 15:07 0:00 /usr/bin/php5-cgi label.php --daemon
root@Deb6Files:/var/log# kill `pidof php5-cgi`
Cpu(s): 0.4%us, 0.1%sy, 0.0%ni, 99.0%id, 0.5%wa, 0.0%hi, 0.1%si, 0.0%st


I think I have enough to submit an issue now.

The last change to label.php was a while ago, so I think the change happened elsewhere that caused this, but I don't know enough to dig for it.
http://code.google.com/p/rutorrent/source/diff?spec=svn1709&r=1709&format=side&path=/trunk/plugins/autotools/label.php&old_path=/trunk/plugins/autotools/label.php&old=1176
 

peshua19

Member
May 25, 2018
897
0
16
Nothing that looks useful I'm afraid:

Code:
[20.07.11 22:34:25]
[20.07.11 22:34:25] AutoWatch: --- begin ---
[20.07.11 22:34:25] AutoWatch: enabled : 0
[20.07.11 22:34:25] AutoWatch: autostart : 0
[20.07.11 22:34:25] AutoWatch: --- end ---
[20.07.11 22:39:25]
[20.07.11 22:39:25] AutoWatch: --- begin ---
[20.07.11 22:39:25] AutoWatch: enabled : 0
[20.07.11 22:39:25] AutoWatch: autostart : 0
[20.07.11 22:39:25] AutoWatch: --- end ---
I added a 4 torrents while it ran in debug,
Cpu(s): 40.2%us, 49.2%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.2%si, 10.4%st
More seem to compound the load.
 

lisas4567

Member
May 25, 2018
773
0
16
Try to comment 3 lines in label.php and try again.
E.q. must be:

Code:
// $AutoLabel_Sem = rtSemGet( fileinode( __FILE__ ) );
// rtSemLock( $AutoLabel_Sem );
...
// rtSemUnlock( $AutoLabel_Sem );
 

saroos1

Member
May 25, 2018
718
0
16
Didn't work sad.gif

autotools loaded, no error, but load issue still happened. rm -rf autotools dropped the load instantly.

I could give you access to my testing VM if you'd like.