OpenWrt Forum Archive

Topic: Transmission daemon huge RAM utilization

The content of this topic has been archived on 24 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

In this days I've tried the transmission daemon on my router, and I ran into the problem described into the topic subject.
I've tested the demon on an APU1d board with 2GB of RAM (and dual core CPU @1GHz), that for a router is a lot of RAM, and even with so much RAM, I've seen that Transmission can easily saturate memory it with only 2 active torrent...
This is a massive RAM utilization!!!!

So there's anyone which can suggest me a workaround to fix this RAM dispersion problem?
any help would be appreciated.

Thank you very much in advance.

EDIT: possible solution: https://forum.openwrt.org/viewtopic.php … 38#p270338 (Thanks to jmarunix)

(Last edited by mirko_47 on 30 Mar 2015, 16:21)

I found rtorrent to be much more efficient RAM-wise than Transmission. How many torrents have you loaded (you mention 'active' torrents, which seems to suggest Transmission keeps a list of more torrents).

I don't know the internals of both programs, but maybe Transmission has a memory leak - do you see RAM usage going up steadily? In the end oom killer should throw it out.

Thank you very much for the answer,

I've loaded only 3 torrents: the newer version of ubuntu, debian and proxmox.
They aren't very heavy, the two that I've said that they were active are debian and proxmox.

In any case, yes RAM usage increases steadily, the strange fact is that OOM killer doesn't kill transmission, but it begins cutting Wi-Fi connection first, and then all the other network connection.

Today I've also tested Transmission deamon with DD-WRT, and i ran into the same problem, so it might be a bug of transmission.

Sorry for the noob question, but what do tou seggest to report this problem to developer?
open a ticket on OpenWRT Trac, or on transmission Trac?

Thank you very much again!

This is my experience.
I use Transmission on my OpenWrt box wich has only 128 MB of RAM.
I observed the RAM increasing over time (weeks) and the swap utilization as well but I have never had problems of memory saturation even with large torrents (20 GB and more per file).
I have my system currently up since more that 1 month and torrent is running fine.

root@OpenWrt2:/# uptime
 09:34:52 up 39 days, 16:57,  load average: 0.13, 0.09, 0.10
root@OpenWrt2:/# free
             total         used         free       shared      buffers
Mem:        126324       122444         3880            0        15016
-/+ buffers:             107428        18896
Swap:       524284          608       523676
Mem: 122344K used, 3980K free, 0K shrd, 15016K buff, 61480K cached
CPU:   9% usr   0% sys   0% nic  90% idle   0% io   0% irq   0% sirq
Load average: 0.03 0.07 0.10 1/68 2508
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 2508  2208 root     R     1364   1%   9% top
16424     1 root     S    15316  12%   0% /usr/bin/transmission-daemon -g /mnt/
24747     1 root     S     4796   4%   0% /usr/sbin/openvpn --syslog openvpn(my
 1394     1 root     S     2556   2%   0% /usr/sbin/nmbd -D
 1385     1 root     S     2488   2%   0% /usr/sbin/smbd -D
 1500     1 root     S     1728   1%   0% /usr/sbin/rpc.mountd -p 32780 -F
 1431     1 root     S     1596   1%   0% /usr/sbin/hostapd -P /var/run/wifi-ph
 1438     1 root     S     1592   1%   0% /usr/sbin/hostapd -P /var/run/wifi-ph
  993     1 root     S     1544   1%   0% /sbin/netifd
 1282     1 root     S     1540   1%   0% /usr/sbin/uhttpd -f -h /www -r OpenWr
22033     1 root     S     1420   1%   0% {dynamic_dns_upd} /bin/sh /usr/lib/dd
    1     0 root     S     1392   1%   0% /sbin/procd
 1461     1 root     S     1364   1%   0% /usr/sbin/ntpd -n -p 0.openwrt.pool.n
 1039     1 root     S     1364   1%   0% /usr/sbin/crond -f -c /etc/crontabs -
 2325  2324 root     S     1364   1%   0% -ash
 2208  2207 root     S     1364   1%   0% -ash
 1161   993 root     S     1360   1%   0% udhcpc -p /var/run/udhcpc-eth0.2.pid
 2480 22033 root     S     1352   1%   0% sleep 600
 2207  1144 root     S     1220   1%   0% /usr/sbin/dropbear -F -P /var/run/dro
 2324  1144 root     S     1220   1%   0% /usr/sbin/dropbear -F -P /var/run/dro

Try to stop and restart the Transmission daemon to see if you can free up some RAM.
You may also want to install htop to see the actual amount of RAM being used by Transmission daemon and how much it increases over time.

@Mittler:
Which version of Transmission daemon you're currently running?
I forgotten to to write into the first post, I was talking about the version 2.84-1

Thanks.

(Last edited by mirko_47 on 18 Jan 2015, 12:27)

mirko_47 wrote:

@Mittler:
Which version of Transmission daemon you're currently running?
I forgotten to to write into the first post, I was talking about the version 2.85

Thanks.

I'm using the version that comes with OpenWrt 14.07 it should be 2.84
I installed it on my router using the Luci GUI.

Did you try utorrent?

(Last edited by spy00a35 on 19 Jan 2015, 15:50)

Hello all,
Like any of you, I have tested transmission-daemon on my minimalist router Comtrend-ar5387un with the same problem of huge RAM use and, of course, crahses and freezes of the system.
But some days ago I think I found a solution. The problem isn't a bug in the program, it is a simple adjustment of kernel settings.
You can see this across the command logread and setting this parameter in the transmission config file:

/etc/init.d/transmission stop
vim /etc/config/transmission
option message_level '2'
/etc/init.d/trasnmission start

After launch logread, you can see something like:

Sat Mar 28 22:02:53 2015 daemon.err transmission-daemon[1445]: UDP Failed to set receive buffer: requested 4194304, got 327680 (tr-udp.c:78)
Sat Mar 28 22:02:53 2015 daemon.info transmission-daemon[1445]: UDP Please add the line "net.core.rmem_max = 4194304" to /etc/sysctl.conf (tr-udp.c:83)
Sat Mar 28 22:02:53 2015 daemon.err transmission-daemon[1445]: UDP Failed to set send buffer: requested 1048576, got 327680 (tr-udp.c:89)
Sat Mar 28 22:02:53 2015 daemon.info transmission-daemon[1445]: UDP Please add the line "net.core.wmem_max = 1048576" to /etc/sysctl.conf (tr-udp.c:94)

The solution became adding this lines to /etc/sysctl.conf :

net.core.rmem_max=4194304
net.core.wmem_max=1048576

And executing:

/etc/init.d/transmission stop
sysctl -p
/etc/init.d/transmission start

For several days the router, with some active torrents, has behaved stably and the crashes have disappeared.

jmarunix wrote:

Hello all,
Like any of you, I have tested transmission-daemon on my minimalist router
[cut]
For several days the router, with some active torrents, has behaved stably and the crashes have disappeared.

@jmarunix: thank you very much for your anwer.
Unfortunately I'm not using anymore Transmission, so I can't test your solution at this moment.
In any case I've linked your post to my initial post as a possible solution.
Thank you very much again.

I have Transmission running on my TP-Link WL1043ND (64mb) router using Gargoyle. (GUI on top of OpenWRT) Transmission was working ok until I gave it some torrents to download. It was then crashing constantly and restarting etc. If it lasted 10 minutes it was doing well....

I used "logread" on the command line and found the memory error you list above. I followed your instructions and corrected it and found it to improve things a little but I had an additional problem. I realized that my router wasn't using a swap file. I checked this by using "free". Swap size was 0! I had my USB hard disk formatted to Ext 4 (which made a huge improvement over NTFS which was real slow) and a swap partition setup but it wasn't being used.

Obviously it has to be manually enabled. On the command:
    vi /etc/config/fstab
Make sure that the option under swap is set to 1. Restart the router and check by typing free. It should indicate a swap partition size more than 0. Mine did and now that the swap is properly working I have found Transmission to be reliable and no longer freezing the router. I have 4 downloading at full speed (about 1mb per second) and about 25 seeding. Only about six are actually uploading through. But all is good and working properly even though cpu usage is high. (1.2)

Transmission needs quite a lot of memory and that memory needs to be set up properly. I have learnt the hard way on this. If any one out there is having the same problems I have had then hope this helps.

Try reduce cache size to 1mb or 0mb. I can run transmission + samba without freeze 32MB mr3020 by set cache to 0mb.

(Last edited by tomrev on 26 Oct 2015, 08:14)

The discussion might have continued from here.