BIttorrent troubles. PLEASE HELP!

Discussion in 'HyperWRT Firmware' started by r69med, Dec 27, 2005.

  1. r69med

    r69med Network Guru Member

    ok so after loading tofu11 resetting default settings and vram and adding the following line into my startup script:

    echo "600 1800 120 60 120 120 10 60 30 120" > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts

    i've reached an awe-inducing max router UPTIME while dling 4 torrents with Azureus of 30 FREAKIN MINUTES

    there's no explanation for how terrible this is with the firmware upgrades i have.

    is there something i'm missing here? something i'm not doing?? this is extremely frusterating and if someone could help me out here it would probably prevent me from losing my mind. thanks

    my system: Comcast High Speed; Motorola Surfboard SB4200 Cable Modem; Linksys WRT54G v4; 1 cpu hardwired to router; 2 laptops running wirelessly
  2. NateHoy

    NateHoy Network Guru Member

    How many connections do you have your BitTorrent client set for?

    I have at least 100-200 connections running on 6 torrents at the moment, and I'm up to over 19 days of continuous BitTorrent feeds, with no reboots at all.

    Here is my startup script:

    echo 4096 > /proc/sys/net/ipv4/ip_conntrack_max
    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
    echo "600 1800 120 60 120 120 10 60 30 120" > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts

    Other than that, I'm running QoS, wireless is up some of the time but not used a lot.

    I'm assuming you aren't running BT over the wireless LAN, right?
  3. jblade

    jblade Network Guru Member

    what do all the other lines besides the last one do?
  4. NateHoy

    NateHoy Network Guru Member

    ip_conntrack_max changes the maximum number of connections.

    icmp_echo_ignore_broadcasts blocks pings (reduces traffic from the net)

    icmp_ignore... ignores invalid error responses.

    You know, come to think of it (directed at R69MED):

    1/2 hour is the active timeout. Are you being killed at EXACTLY 1/2 hour? Get out your stopwatch and time it. If it's within a few minutes of 1/2 hour, you may start with playing around with that "1800" number (the second in the list of numbers in your script). If it is, then something in that idle cleanup is killing you, or you are simply running out of connections just BEFORE the router was going to do something about it.

    Try increasing it to "3600" (one hour) and see if you can go an hour, and decreasing it to "600" (10 minutes) to see if you are just running out of connections, which will max out at 2,048 in Tofu unless you change it.

    I'd also add the ip_conntrack_max line as that may buy you more time.

    There's also another startup script that can be found right on Tofu's home page, which adds some additional changes that change the cleanup parameters for IP connections (gc_thresh settings). Here is the full script, which adds features to start cleaning at 512 connections, target 2048 connections as "ideal", and stay below 4096 connections all the time:

    echo 4096 > /proc/sys/net/ipv4/ip_conntrack_max
    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
    echo 512 > /proc/sys/net/ipv4/neigh/default/gc_thresh1
    echo 2048 > /proc/sys/net/ipv4/neigh/default/gc_thresh2
    echo 4096 > /proc/sys/net/ipv4/neigh/default/gc_thresh3
    echo "600 1800 120 60 120 120 10 60 30 120" > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts
  5. jblade

    jblade Network Guru Member

    What's tofu's website?
  6. r69med

    r69med Network Guru Member

    ok i'm restarting my torrents now and timing them this time. only running bt on my desktop thats hardwired into the router. my max connections were initially set @ 400 and i just lowered them to 200 so we'll see wat happens. thanks for the tip.
  7. neoufo51

    neoufo51 Network Guru Member

    Be sure that you visit your BT client's website and make sure you know the best setting for the client according to your ISP connection. I would highly suggest uTorrent as it has worked flawlessly for me these past few weeks and the clients site forum has a link to a page that optimizes your BT settings.
  8. NateHoy

    NateHoy Network Guru Member

  9. r69med

    r69med Network Guru Member



    its been over 10 hrs and still rolling. not sure if its the new firmware script or the complete router cleanup but i really dont care!!

    thanks to everyone

    one quick question, how high can i set my bt max connections to and still be functioning? 1000?
  10. NateHoy

    NateHoy Network Guru Member

    WooHoo! Glad to hear things are rolling for you. I've found all of the script but the last line to be pretty useless, and setting my number of connections too high impacts performance on my old DOCSIS 1.0 modem. I suspect it was the NVRAM cleaning. ;)

    As to max: Dunno. Never maxed it, but I don't go over 200 connections at a time, most of the time (most of what I share is obscure old TV programs, and Linux distros, and I clamp upload at 10 queues per share since I only get 15kB upload on a normal day). My torrent client is maxed out at 500, but I never even come close.

    However, you'll have to experiment around a bit. Here are your variables.

    1. Total number of connections: When you reach this, the router will hork. Set it too high, and your cable modem may not handle the load, and may die.

    2. Idle timeout: The shorter this is, the more connections can be freed up. But set it too short, and you'll find valid BT connections that just haven't seen any traffic for a while vanishing on you.

    Remember - your total connection count (that matters for this discussion) is the number of ACTIVE connections. With the cleanup set to "1800", any connection that has been established or has seen any activity at all within the last half hour is ACTIVE and will not be cleaned up. So setting your total connection count to 1000, with lots of simultaneous connects, might overload even the 4,096 connections you have it set to.

    So, long story short, you'll have to play with settings. 1,000 simultaneous connections is a LOT with something like BT where connections are made and lost all the time. You may be able to get away with it by tightening up the cleanup interval, but then you may start losing valid but very slow connections.

    Uptime : 20 days, 01:19:28

    (I need to figure out a way to send this data up to my web server so I can include it in a signature icon. LOL)
  11. r69med

    r69med Network Guru Member

    my bittorrent has been running long as the down rates have stayed below 100k it seems

    today i hit 700k on ONE torrent alone.
    after sustaining the speed for 20 minutes the router cut out.
    i've left my max connections for the entire bt network to 450

    is that too much? what exactly causes my router to kick after such high speeds?
  12. enx23

    enx23 Network Guru Member

    p2p and WRT54G

    Definitely there is a problem with WRT54G and P2P applications (e.g. emule). I have tried many firmwares for WRT54G (even tofu 11) and if a P2P is running for long time (e.g. days) there will appear wireless disconnects. I have noticed that I was getting wireless disconnects on my wireless laptop if and only if a P2P software was running on my desktop PC which is connected to WRT54G router thru a cable. If I was stopping the P2P application on the PC the wireless disconnects were going away immediately. The problem seems to be that IP table becomes full due to too many connections, see here for more details <> . The fix is to have in the startup script the line:
    echo 16384 > /proc/sys/net/ipv4/ip_conntrack_max.

    I use the following startup script:

    echo 16384 > /proc/sys/net/ipv4/ip_conntrack_max
    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
    echo 512 > /proc/sys/net/ipv4/neigh/default/gc_thresh1
    echo 2048 > /proc/sys/net/ipv4/neigh/default/gc_thresh2
    echo 4096 > /proc/sys/net/ipv4/neigh/default/gc_thresh3
    echo "600 1800 120 60 120 120 10 60 30 120" > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts

    together with firmware Tofu11 <> and it works like a charm for me. I have no more wireless disconnects when I use P2P software. I have used this startup script for months and I have not noticed any ill effects whatsoever. If this script doesn’t work for you then maybe you should consider changing the line:
    â€echo 16384 > /proc/sys/net/ipv4/ip_conntrack_maxâ€
    â€echo 65536 > /proc/sys/net/ipv4/ip_conntrack_maxâ€.

    Also I have noticed that when I use no startup script and limit the number of connections in the P2P software (e.g. emule) I get no wireless disconnects BUT the download speed in the P2P software is crippled because of this. I do not consider a good solution limiting the number of connections in any application because the hardware should work as is supposed to work.
  13. Airwalk

    Airwalk Network Guru Member

    PLEASE HELP!!!!!!

    PLEASE HELP!!!!!!

    I think I might have a problem:

    My utorrent is really slow: max DL I get is up to 10-15KB avg is in fact maybe 2-5kb
    I have adsl 1200
    I have a linksys WAG54G ver 2

    Any suggestions????

    Please help!!!!!!!!!!
  14. whozyodaddy

    whozyodaddy Network Guru Member

    Re: PLEASE HELP!!!!!!

    Forward your BitTorrent ports in your router, and disable your Windows firewall or allow the ports in your firewall software.
  15. Airwalk

    Airwalk Network Guru Member

    How do I do that ? Sorry, not very much into that. Could you please tell me step by step?
  16. whozyodaddy

    whozyodaddy Network Guru Member

  17. Airwalk

    Airwalk Network Guru Member

    Many thanks, dude. Will try to do as you suggested and come back to you. :thumbup:
  18. pharma

    pharma Network Guru Member

  19. snwbdr

    snwbdr Network Guru Member

    Re: PLEASE HELP!!!!!!

    found this:

    I use azureus, You have to configure it right to take advantage of your connection speed. Also it depends on having a good torrent bad torrent. How many people uploading and do they have a fast connection. Here is some more info, don't know to much about utorrent but there is some good info here
  20. Airwalk

    Airwalk Network Guru Member

    Hi everyone!

    FIRST: Thanks to ALL who tried to help me!
    SECOND: This is what I did and it works!!!!

    Opened the Linksys settings from the IE and chose Single Port Forwarding: Typed in the port BitTorrent is using, saved, and after a few minutes BiTtorrent went from arg 4kb to avg 60kb.
    One more thing: I did not chose ANY Static IP!!!!

    Hmmm this is soooo coooool

    thanks again,
    Airwalk :cheering:
  21. Thibor

    Thibor Super Moderator Staff Member Member

    glad it's working for you. by "chose Single Port Forwarding" do you mean Port Triggering?
  22. Airwalk

    Airwalk Network Guru Member

    Yes that is exactly it!! :thumb:
  23. j300567

    j300567 Guest

    hey mate, actually i am using model BEFSR41, which is the wired one. i wonder would that firmware work with mineone? cozi 've got a huge disconnecting problem when using BitComet.

    thanks a lot!
  24. DrunkenFcuk

    DrunkenFcuk Guest


    I am also experiencing slow BT speeds using my WRT54G V2. I currently use DMZ, which I believe forwards ALL ports to the specified IP address. Does this mean forwarding the BT 6xxx ports would not solve my problem?

    My main problem is that my Internet connection degrades over time, and I am forced to reboot the WRT every couple hours or so. I have an ADSL 1.5M/256K connection, which has a max download speed of ~150K. I DO get up around this speed in BT sometimes (depending on the speed of the torrent's peers), but only after I have just rebooted the router and only until it degrades again. And to top it off, I can't perform any other Internet tasks -- such as web browsing or checking email -- while downloading torrents, EVEN with QoS enabled and set up to give HTTP/SMTP higher priority than BT. :(

    In terms of firmware, I have tried several -- including the official FW, Alchemy and DD-WRT -- without success. I plan on giving tofu 12 a go, since it allows custom startup scripts, so hopefully that will ease my pain.

    It may be a hardware problem -- since my WRT has worked without any problems until just recently -- but I don't know what could cause this sort of intermittent problem. I know the unit isn't overheating.
  25. r69med

    r69med Network Guru Member

    ok i'm back. and i'm frusterated...every change i've made to my router settings have worked but only for the short-term. in the end i still end up having to reboot my server ever 2-3 days. on top of that. my bt is running a lot slower than i'm used to. down rates fluctuate between 5k and 30k every other second. this is the script i'm currently running:

    echo 16384 > /proc/sys/net/ipv4/ip_conntrack_max
    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
    echo 512 > /proc/sys/net/ipv4/neigh/default/gc_thresh1
    echo 2048 > /proc/sys/net/ipv4/neigh/default/gc_thresh2
    echo 4096 > /proc/sys/net/ipv4/neigh/default/gc_thresh3
    echo "600 600 120 60 120 120 10 60 30 120" > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts

    i have my BT limited to 300 global connections.
    honestly what more can i do?!?
  26. neoufo51

    neoufo51 Network Guru Member


    I asked the forum moderator at about this script and he said it was NOT a good idea to use the gc_thresh tweaks. Remove them and see what happens.

    Also, I assume you port forwarded, right?
  27. r69med

    r69med Network Guru Member

    yes i have the appropriate ports open for my BT client

    EDIT: ok i just deleted those tweaks....after 12 hrs my router timed out again. I HATE LINKSYS!!! NOTHING HAS WORKED!!! ARGGGHHHH

    i'm also really starting to despise azureus. besides being a freakin resource hog, i cant help but think its throttling my downloads somehow...

    NAteHoy where are you???
  28. callous

    callous Network Guru Member

    How do i find out the total number of connections used by:

    What settings are you using for each?
  29. evil-doer

    evil-doer Network Guru Member

    help > show statistics
  30. snwbdr

    snwbdr Network Guru Member

    I am using thibor 13d and azureus and my download speeds are fine up to 300KB/s I suggest upgrading to Az 2.4 as it has new encryption. Your download speed depends on your upload speed. From what I have read if you don't upload enough the BT client will download to a peer that is uploading more of the files that it needs. I have my up speed set to 35KBytes/s on a 360 kbits/s upload. Which is 80% of my upload bandwidth. My download bandwidth is 6000 kbits/s. I also have it set to 4 upload slots per torrent. I will only upload to 4 people at a time anymore and it slows it down. also I only allow 2 active torrents. Anymore and it slows it down. use this calculator based on your UPLOAD speed.
    It works. You might be doing better than you think too. go to tools>statistics>activity in azureus. It shows the swarm average and what you are getting. I am always more than twice the swarm speed. Also I would download the safe peer plugin it blocks out something like 70% of the internet trying to slow down torrents and upload bad torrents. If it is a resource hog uninstall all of your java. Then download something like CC Cleaner and clean the registry restart and download newest version of java JS2E Runtime Environment 5 Update 6. restart computer. Some plugins maybe the reason for the high cpu usage too. disable them and renable them one by one. for me it was the 3d view plugin it would crash AZ so I uninstalled it. Do not use standard ports. Like 6881 and 6969 some ISP will block these or cap them or something. In AZ 2.4 the encryption feature will help. I use unpn on AZ a plugin and HyperWRT Thibor 13d It uses 2 ports one is XXXXX for tcp and udp and one is XXXXX for tcp I think. I don't use qos or port forwarding at all.

    Useful links

    Read all of first aid very useful:
    CC Cleaner:
    Java download:
    Azureus settings based on upload speed:
    Speakeasy speed test to find upload speed:
    Legal torrents to compare download speed with someone else:
    I2P with Azureus (will slow connection):
    Traffic shapping new encryption:
    Thibor's page:
    Tofu's page:
    hope this helps
  31. lurtis

    lurtis Network Guru Member

    startup script works for me

    ive had troubles in the past with BT causing disconnects but this startup script worked for me.

    echo 4096 > /proc/sys/net/ipv4/ip_conntrack_max
    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
    echo "600 1800 120 60 120 120 10 60 30 120" > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts

    ive tried adding those "gc_thresh" values in the past as suggested in one of these posts before but it just slowed down the router it seems.

    Im on a WRT54G v2.2 with Tufu13c running G-only devices and no pc's hardwired with WPA2/AES enabled. Uptime is somewhere around 4 weeks. i havent really checked what the status page says cause i havent had to change anything since that startup script was put in :drinking: so cheers to you guys hehe
  32. pharma

    pharma Network Guru Member

  33. callous

    callous Network Guru Member

    Are there any extra steps for GSv3.0 upgrading from DDWRT v23 to Thibor 13d?

    I need to:
    1)reset to factory default
    2)clear nvram
    3)just flash to thibor 13d?
  34. vincentfox

    vincentfox Network Guru Member

    I wish this 16,384 setting would not get bounced around quite so much.

    Let's do a little math here:

    16,384 * 205 = 3358720 bytes /. 1024 = 3,280K

    Do you really need a 3.2 meg connection table? Probably not. And there are probably other programs running on the router that need to share that RAM. This is especially important on the units with less RAM.

    I can't see any sense in going past 4,096 which is less than a meg.

    In any case, many of these P2P apps IMHO should be better coded to be "good neighbors" to the network, and not act on the assumption that network resources are limitless. I inevitably see, after P2P users *finally* get everything stabilized, that they start looking into QoS. Another "hack" to work around the fact that P2P by default sucks up all resources and leaves nothing left over for VoIP or interactive traffic in general.

    My 2 cents.
  35. callous

    callous Network Guru Member

    I managed to update to thibor 13d without incident.

    Damn this firmware looks great!

    I wish there was a way to reset the amount of data transferred on the WAN (rx/tx) so that if i upgrade the firmware on a weird month day, I can track my usage per month for my ISP.
  36. bob332

    bob332 Network Guru Member

    Re: PLEASE HELP!!!!!!

    i am using uTorrent and also the info from their site listed above with the WRT54G and it works excellent, no probs.
  37. seabee

    seabee Guest

    hey all,

    I just flashed my WRT54G v.3 to Thibor14 and it improved my BT problems (probably mostly due to the timeout setting).

    Now my download times are great and peak download rates are awesome, but look at this:


    It seems the router (or something) craps out periodically. I've tried the above startup scripts and tweaking the max connections from default to 4096 to 16384.. no luck. This is when downloading a 180 mb file of a recent episode of a sitcom (so there's tons of peers/seeds).

    any thoughts on what it could be? thanks.
  38. dagnasty

    dagnasty Network Guru Member

    I sure hope it was "the Office" otherwise you'd be commiting a crime

    against humanity.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice