How can I only allow say 10 concurrent torrents?

lisas4567

Member
May 25, 2018
773
0
16
I too have doubts.

The max_downloads_global = 20 and max_uploads_global = 20 won't work for me as rtorrent DOES use more connections despite these limits being set. I've even moved the settings up the config as per this thread but it still makes more connections. http://libtorrent.rakshasa.no/ticket/1422

So in my case, setting globals so that 1 runing torrent uses 40 connections or 20 running torrents use 2 connection each does not work.
If I run 20 torrents there are well over 100 connections despite the limit being set to 40 (20 up, 20 down).
:/
 

saroos1

Member
May 25, 2018
718
0
16
>How can I only allow say 10 concurrent torrents?

add to rtorrent.rc line

scheduler.max_active.set = 10

works for 0.8.6, set limit for acive torrents (both seeding and downloading).
 

lisas4567

Member
May 25, 2018
773
0
16
That sounds very good.

Do you now if when I set the value to 10, if a new torrent will start when another one stops (if I have 10 running)?
As i could not find much about the added scheduler, and saw some more commands :

'scheduler.max_active'
'scheduler.max_active.set'
'scheduler.simple.added'
'scheduler.simple.removed'
'scheduler.simple.update'
 

peshua19

Member
May 25, 2018
897
0
16
I too have doubts.

The max_downloads_global = 20 and max_uploads_global = 20 won't work for me as rtorrent DOES use more connections despite these limits being set. I've even moved the settings up the config as per this thread but it still makes more connections. http://libtorrent.rakshasa.no/ticket/1422

So in my case, setting globals so that 1 runing torrent uses 40 connections or 20 running torrents use 2 connection each does not work.
If I run 20 torrents there are well over 100 connections despite the limit being set to 40 (20 up, 20 down).
:/
 

peshua19

Member
May 25, 2018
897
0
16
woah, that's weird.


my reply was :

It most certainly does work, i see this a lot...people either have a misunderstanding of how the settings work, or they have a misunderstanding of the results....either way, the .rtorrent.rc settings work perfectly.
 

lisas4567

Member
May 25, 2018
773
0
16
woah, that's weird.


my reply was :

It most certainly does work, i see this a lot...people either have a misunderstanding of how the settings work, or they have a misunderstanding of the results....either way, the .rtorrent.rc settings work perfectly.
I tested this and can say the following :

* Torrents are loaded in STOP status
* if you stop an torrent , a new one will start
 

randac56

Member
May 25, 2018
915
0
16
I tested this and can say the following :

* Torrents are loaded in STOP status
* if you stop an torrent , a new one will start
Really, I'm made up it works for you, but I can tell you it isn't working here!

My .rtorrent.rc (for test purposes)
Code: [Select]
# Maximum number of simultanious connections global.
max_uploads_global = 40
max_downloads_global = 60

# Maximum and minimum number of peers to connect to per torrent.
min_peers = 0
max_peers = 40

# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 0
max_peers_seed = 25

# Maximum number of simultanious uploads per torrent.
max_uploads = 15

# Global upload and download rate in KiB. "0" for unlimited.
#download_rate = 0
#upload_rate = 0

# end connection settings
So the global connection limit is 100 (60 down and 40 up)
My understanding is that rtorrent wiill not make more than 100 connections with this setting.

OK.

Here is my rutorrent running with those settings.


Now it "looks" as though there's more than 100 connections going on here, so lets check netstat:

netstat -ant | grep PORT | wc -l
result=888

So rtorrent is set to make no more than 100 connections globally yet nestat shows 888!

Lets drill down into those connections:

netstat -ant | grep PORT | awk '{print $6}' | sort | uniq -c | sort -n

Result:
1 FIN_WAIT1
1 FIN_WAIT2
1 LISTEN
2 CLOSING
3 SYN_RECV
227 TIME_WAIT
657 ESTABLISHED


So, on my system, the max_peers and max_peers_seed per torrent seem to be working fine as seen in the rutorrent screenshot above but the global connections is surely above 100 by anyones understanding!
 

peshua19

Member
May 25, 2018
897
0
16
that netstat isn't only showing rtorrent.

Looking at your screenshot, i would imagine it's correct. it's only showing 11 active torrents. 100 connects between 11 active sounds about right to me
 

lisas4567

Member
May 25, 2018
773
0
16
That netstat IS only showing the number of connections on ONLY the torrent port (notice PORT in the netstat commands, real port edited out)

Also, active screenshot:



That's not 100 connections!

Lets do netstat again, just to be sure!

netstat -ant | grep PORT | awk '{print $6}' | sort | uniq -c | sort -n
1 CLOSING
1 LISTEN
1 SYN_RECV
2 FIN_WAIT1
242 TIME_WAIT
656 ESTABLISHED

netstat -ant | awk '{print $6}' | sort | uniq -c | sort -n
1 CLOSING
1 established)
1 Foreign
2 SYN_RECV
3 FIN_WAIT1
3 FIN_WAIT2
21 LISTEN
283 TIME_WAIT
890 ESTABLISHED

and for sanity

netstat -ant | grep 1000 | awk '{print $6}' | sort | uniq -c | sort -n

no result (nothing running on port 1000)

So you can see, when I run nestat on the rtorrent port its 656 established connections
Run netstat on ALL ports (drop the grep) and its 890 connections.
 

saroos1

Member
May 25, 2018
718
0
16
Ok, then I guess I've misunderstood what these globals stand for.

My misunderstanding stems from the min_peers and max_peers setting (on a per torrent basis) and the fact I thought max_uploads_global and max_downloads_global was a global setting for the overall number of peers connecting.
ITS NOT!

The global uploads and downloads is purely for controlling the number of simultaneous peers that can transfer data, NOT for the number of peers that can actually connect. (which can only controlled on a per torrent basis via .rtorrent.rc AFAIK)

So yeah, globals do work, but just not the way I expected!

So now I'm off to find a way to limit the number of connections rtorrent can accept/make because 600+ connections used when only 100 are active is no use to me!

And I now have the answer!

Add
max_open_sockets = X
to .rtorrent.rc

grin.gif

Thanks for the tips which eventually helped me find the solution
 

peshua19

Member
May 25, 2018
897
0
16
Thanks for that Novik,
Will test when I have another go at the latest builds of rtorrent/libtorrent which just failed to work for me, so I went back to x.x.6 which still works fine with ruT3.2
When I tried to connect to rtorrent via ruTorrent 3.2, rtorrent crashed.
The screen log reports "rtorrent Caught Segmentation fault, dumping stack" which only happens when I try and use ruTorrent with the latest builds of rtorrent-0.8.7 / libtorrent-0.12.7
Similar report here: http://help.lockergnome.com/linux/Bug-606796-rtorrent-segmentation-fault-xmlrpc-armel--ftopict529839.html
Reverting back to rtorrent-0.8.6 / libtorrent-0.12.6 does not throw up this or any other error so will have to stick with that until I find out what this segmentation stuff is about.
 

lisas4567

Member
May 25, 2018
773
0
16
See the first page of ruTorrent project. You *can't* use 0.8.7 with ruTorrent (and with another front-end for rTorrent). You *must* use stable 0.8.6, or current rtorrent svn.
 

saroos1

Member
May 25, 2018
718
0
16
Just noticed that! Wish I'd noticed it earlier. Would have saved me 3 hours of banging my head on the table.