+ Reply to Thread
Results 1 to 9 of 9

Thread: Tweaking disk cache in µtorrent 100/100 Connections only

  1. #1

    Join Date
    03.09.09
    Posts
    270
    Activity Longevity
    0/20 14/20
    Today Posts
    0/5 ssssss270

    Tweaking disk cache in µtorrent 100/100 Connections only

    !!!This guide is for people with 10/100mbit connections ONLY!!!

    For high speeds you need a bunch of very fast drives that can get fast transfer rates at a high number of random reads/writes. While under Linux you can get high transfer rates with fast drives easly, under Windows you can't.


    Here I will show you how to overcome this.


    1. Using Disk Cache.

    The trick here is to write the data in the RAM and then write it off to the disk in as sequential as possible pattern = higher write speed. You can specify how much of your RAM you want to dedicate as a cache for Utorrent here:

    Options -> Preferences -> Advanced -> Disk Cache

    There are 2 possible scenarios:

    - You specify a cache size at least as big as your torrent file size so the whole torrent will get cached very fast in your RAM and then you will have to wait a bit for it to write off completely.

    (CAUTION : Power failure and/or HDD crash may adversely effect downloaded data and/or data under pipeline, and you may lose data in case of an unforeseen even of a power failure or HDD crach beyond recovery : This is a drawback of the first scenario discovered by anon)

    Practically this means that you will download the torrent to your RAM possibly at a very high rate and then when it reaches 99.9% completion it will start to write out the remaining pieces from the RAM to your hard drive and you will have to wait for it to finish (it can take a while depending on the file size) . You can monitor the write out process in the Pieces subtab. This is a very good way to get the torrent the fastest way you can with a slow hard drive.
    The bad think about it is that most of the time you won't have enough free RAM to reserve for caching simply because the files will be too big.

    - You specify a compact cache size and adjust simultaneously the number of connections and the download speed to avoid disk overload.

    Disk overloads occurs when the cache gets full and the disk can't keep up writing out the data fast enough. If it occurs the best way to fix it is to either increase the cache size or stop the torrent, wait for all the pieces from the cache to get written out, and lower the number of connections per torrent and the download speed. The best way to tell if your hard disk can keep up with the current speed is to monitor the Pieces subtab window and see if the pieces number grows or shrinks. If the pieces list is getting bigger and bigger then the disk writes out pieces slower then they are written into the RAM (cache) and if the torrent size is fairly big the disk will overload at some time when the cache gets full. The best case is when the pieces are written out about as fast as they are written in the cache, so there is no danger of filling in the whole cache. Usually its best to allow 10-20 peers to connect to you at the start and raise the number by 5 until you reach the fastest speed at which the disk can keep up with the pace. Keep in mind that downloading from more peers at slower rates is more stressful for the disk then downloading from fewer peers at higher rates.

    The bad thing about using only disk caching is that you can get high speeds only in one direction, either uploading or downloading fast. If you start downloading something fast your upload speed will cripple down when the disk starts to write out the pieces. If you have a Gbit line don't expect to get more then 15-20 MB/s with caching.

    Here are some settings when using disk cache:





    > Write out untouched blocks every 2 minutes: Disabled

    > Write out finished pieces immediately: Enabled


    Clears up the cache for new pieces as fast as possible

    > Turn off read caching if the upload speed is slow: Disabled

    > Remove old blocks from the cache: Enabled

    > Increase automatic cache size when cache trashing: Enabled


    You could enable it if you want the cache size to automatically increase if it gets filled in or disabled it if you want to have a fixed sized cache.




    2. Using RAM Disk.

    To get really fast DL/UL under Windows simultaneously in both directions you will need to use a RAM Disk.

    A RAM Disk is a part of the RAM which gets reserved and used as a logical drive, of course all the contents on it are erased when the computer restarts/shuts down. The good thing about the RAM Disk is that it can utilize Gbit speeds and it doesn't overload (of course a decent CPU is also needed), the bad thing is that you will need some good amount of RAM to make a good use of it. Of course you can use it only to upload fast smaller releases from it or to download fast releases to it and then move them to the hard drive for seeding, thus enabling you to download and upload fast at once (upload from HDD, download to RAM Disk, or reversed). And if you have a lot of RAM available you can download/upload releases from/to it at rates no hard drive can match. That's especially useful for uploaders, who can FXP releases to the hard drive and seed from the RAM Disk at very high rates. If you want to utilize Gbit speeds under Windows a RAM Disk is a must. When using a RAM Disk make sure that caching is disabled.

    Here are some settings:




    Using 2.5 GB RAM Disk with a 100/100 Mbit connection:




    3. Other important things.

    - Make sure to increase “Global maximum number of connections” and the connected peers/upload slots per torrent values in Options -> Preferences -> Bandwidth, the default values are too low. If you are on DSL/Cable don't set too high values to avoid overloading your router.

    - If you are seeding/leeching a lot of things at a time or simply use a lot of programs that connect to Internet at once you may experience slow connectivity in your torrents (like you are seeing the peers but it takes some time to start transferring data with them), that's probably because of the 10 half-open simultaneous connection attempts (not 10 half-open connections in total) limit by Windows (note that this value varies, depending on the OS version) . To verify that look for event ID 4226 “TCP/IP has reached the security limit imposed on the number of concurrent TCP connect attempts” in your event logs. Luckily you can remove it with 3rd parity tools (google for LvlLord patch). Here is a list of which operation systems have a limit and which not:

    OSes that have a limit:

    - Windows XP SP2 & SP3, Windows 2003 SP1 & SP2, Vista up to SP1, Windows 2008 up to SP1

    OSes that don't/won't have a limit:

    - Windows 2000/2000 Server all versions, Windows XP up to SP1, Windows 2003 with no SP, Vista with SP2, Windows 2008 SP2, Windows 7

    Additionally UT implements also such a limit so you need to lift it off too (default is , go to Options -> Preferences -> Advanced


    >net.max_halfopen - that's the limiting value in UT

    >bt.connect_speed – here you specify how many new connections per second UT will try to create, up to the limit specified in net.max_halfopen.


    Raising the limit too high is not recommended. Also, if you are on DSL/Cable don't set it high because it can overload your router. For example if you set it to 100 half-open attempts your computer will try to reach 100 hosts each second. Now if you have set the connected peers value in UT at 140 for example, and a few peers drop out, you will start sending out 100 requests per second until you connect again to a few peers and the connection limit is full again. Then when someone drops again you will do this all over again.




    Please leave your feedback about outcomes of above implementation
    Last edited by SBcheater; 26.09.09 at 18:09. Reason: correction in heading
    Reply With QuoteReply With Quote
    Thanks

  2. Who Said Thanks:

    Gapo (13.06.11) , Mihai (27.09.09) , alpacino (27.09.09) , slikrapid (27.09.09) , cheatos (26.09.09) , anon (26.09.09)

  3. #2
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    30,058
    Activity Longevity
    8/20 18/20
    Today Posts
    2/5 ssss30058
    Great tutorial. But note:

    - You specify a cache size at least as big as your torrent file size so the whole torrent will get cached very fast in your RAM and then you will have to wait a bit for it to write off completely.
    If there's a power failure before or as you are finishing the torrent, all that data will be lost forever.
    "That door is open. What do you want to do with your key?" -- ADOM 1.1.1
    Reply With QuoteReply With Quote
    Thanks

  4. #3

    Join Date
    03.09.09
    Posts
    270
    Activity Longevity
    0/20 14/20
    Today Posts
    0/5 ssssss270
    Quote Originally Posted by anon View Post
    If there's a power failure before or as you are finishing the torrent, all that data will be lost forever.
    That's a brilliant highlight you have made anon, power failure during disk operation never came into my mind, this is perhaps I am using a UPS, I will surely put your highlight tip in a "CAUTION TAB" in above tut.
    Reply With QuoteReply With Quote
    Thanks

  5. #4
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    30,058
    Activity Longevity
    8/20 18/20
    Today Posts
    2/5 ssss30058
    Quote Originally Posted by ovais View Post
    this is perhaps I am using a UPS
    Most likely If your power ever goes off, you have a few minutes to save your work - others won't.
    "That door is open. What do you want to do with your key?" -- ADOM 1.1.1
    Reply With QuoteReply With Quote
    Thanks

  6. #5
    Advanced User slikrapid's Avatar
    Join Date
    22.06.08
    Location
    astral planes
    P2P Client
    sbi finest
    Posts
    1,979
    Activity Longevity
    7/20 17/20
    Today Posts
    1/5 sssss1979
    Quote Originally Posted by ovais View Post
    power failure during disk operation never came into my mind, this is perhaps I am using a UPS
    regardless of that the OS can also freeze and again the data is lost

    afaik another way to avoid disk caching problems is to spread your downloads/uploads across several hard drives
    Reply With QuoteReply With Quote
    Thanks

  7. #6
    Member alpacino's Avatar
    Join Date
    19.03.09
    Location
    locked in Alchemilla Hospital
    P2P Client
    none, just the toolz
    Posts
    1,370
    Activity Longevity
    7/20 15/20
    Today Posts
    0/5 sssss1370
    Nice tutorial. Correct if I'm wrong, but as you say, this is for seedbox users right? Not only that, you must consider the user in this case is locally using this seedbox, and not as many others that use them remotely right? So in this case the "common user" should be worried about this tweaking, but the SB owner might be.
    it's hip to be square
    Reply With QuoteReply With Quote
    Thanks

  8. #7
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    30,058
    Activity Longevity
    8/20 18/20
    Today Posts
    2/5 ssss30058
    Quote Originally Posted by alpacino View Post
    Not only that, you must consider the user in this case is locally using this seedbox, and not as many others that use them remotely right?
    You can change the disk cache settings from the uTorrent UI, if that's what you mean. And since this makes the box download data to RAM (tremendously fast) and record it to the disk when the torrent finishes, it's useful for both.
    "That door is open. What do you want to do with your key?" -- ADOM 1.1.1
    Reply With QuoteReply With Quote
    Thanks

  9. Who Said Thanks:

    alpacino (27.09.09)

  10. #8

    Join Date
    03.09.09
    Posts
    270
    Activity Longevity
    0/20 14/20
    Today Posts
    0/5 ssssss270
    Quote Originally Posted by alpacino View Post
    this is for seedbox users right?
    No it is not just specific to seedbox users, it target all connections whose bandwidth ranges between 10 - 100 Mbit

    Quote Originally Posted by alpacino View Post
    user in this case is locally using this seedbox, and not as many others that use them remotely right?
    Yes, furthermore this method is not specific to users with a seedbox.
    Reply With QuoteReply With Quote
    Thanks

  11. #9
    Member alpacino's Avatar
    Join Date
    19.03.09
    Location
    locked in Alchemilla Hospital
    P2P Client
    none, just the toolz
    Posts
    1,370
    Activity Longevity
    7/20 15/20
    Today Posts
    0/5 sssss1370
    Quote Originally Posted by ovais View Post
    No it is not just specific to seedbox users, it target all connections whose bandwidth ranges between 10 - 100 Mbit



    Yes, furthermore this method is not specific to users with a seedbox.
    Oh thanks. At first I thought you had made a typo. Where is written 10-100, I thought it should be 100-100.
    it's hip to be square
    Reply With QuoteReply With Quote
    Thanks

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178