BCache + MDADM running extremely slow











up vote
0
down vote

favorite












I have 3x 14TB toshiba drives mdadm-ed (/dev/md0) raid 5'd together that are setup as a bcache. I have a 256GB fast SSD as the front of the bache.



write-back is enabled on bcache.



After a few days, the device (/dev/bcache0) becomes extremely slow. I mean like 1000th of it's normal speed.



My 2 questions are:




  • For /dev/md0, what tuning should I do for those toshiba drives? It's 4k chunks 64k blocks.


  • Is there any bcache tuning I could do?



I'm not even really sure what other info I should put here. But if you ask, I'll update this post. Thanks!



Update 1- my IOSTAT while getting 100mb/sec read, only 3mb/sec write:
https://pastebin.com/wKKf4LTq



The computer is an amd 2990wx w/32gb ram. CPU isn't the issue.



My old 3770k from 2010ish would get hard better read and write speeds than this. It's got to be some sort of setting or tuning. Thanks!



Update 2- While the system is running normally, below is the hdparm output. hdparm takes to long to run when it's not running normally.



/dev/md0:
Timing cached reads: 11148 MB in 2.00 seconds = 5578.33 MB/sec
Timing buffered disk reads: 1372 MB in 3.00 seconds = 456.84 MB/sec
/dev/bcache0:
Timing cached reads: 12564 MB in 2.00 seconds = 6286.57 MB/sec
Timing buffered disk reads: 1226 MB in 3.00 seconds = 408.66 MB/sec


Thanks!










share|improve this question
























  • I hope you understand, that what you have is a very unusual setup because the cache device is larger than the backing device. What exactly did you try to accomplish by setting up the bcache? Try dropping the bcache altogether and use the SSD directly. You will benefit from 10 times bigger storage AND much better performance.
    – Adam Ryczkowski
    Sep 12 at 16:07












  • @AdamRyczkowski oops! I fixed that typo. 14TB! Not GB...
    – Chemdream
    Sep 12 at 16:31










  • What exactly are the speeds of each of those three devices (i.e. SSD, HDD and MD0)? Do you mean sequential read or random read? Just write at least the first significant digit.
    – Adam Ryczkowski
    Sep 12 at 18:30










  • The SSD is a SAMSUNG 860 Pro. Max Sequential Read Up to 560 MBps Max Sequential Write Up to 530 MBps 4KB Random Read Random (QD1): Up to 11,000 IOPS Random (QD32): Up to 100,000 IOPS 4KB Random Write Random (QD1): Up to 43,000 IOPS Random (QD32): Up to 90,000 IOPS The 14TB's are Toshiba MG07ACA14TE. 248 MiB/s Typ. 242 MiB/s
    – Chemdream
    Sep 12 at 19:07












  • Ok, but that is only two devices - SSD i HDD. Could you also put the speed of the md0? I want to get a feeling of the degree of the slowdown you are experiencing. Also it is better to edit the question rather than posting the information in comments. Just to keep all the relevant info in one place.
    – Adam Ryczkowski
    Sep 13 at 5:35

















up vote
0
down vote

favorite












I have 3x 14TB toshiba drives mdadm-ed (/dev/md0) raid 5'd together that are setup as a bcache. I have a 256GB fast SSD as the front of the bache.



write-back is enabled on bcache.



After a few days, the device (/dev/bcache0) becomes extremely slow. I mean like 1000th of it's normal speed.



My 2 questions are:




  • For /dev/md0, what tuning should I do for those toshiba drives? It's 4k chunks 64k blocks.


  • Is there any bcache tuning I could do?



I'm not even really sure what other info I should put here. But if you ask, I'll update this post. Thanks!



Update 1- my IOSTAT while getting 100mb/sec read, only 3mb/sec write:
https://pastebin.com/wKKf4LTq



The computer is an amd 2990wx w/32gb ram. CPU isn't the issue.



My old 3770k from 2010ish would get hard better read and write speeds than this. It's got to be some sort of setting or tuning. Thanks!



Update 2- While the system is running normally, below is the hdparm output. hdparm takes to long to run when it's not running normally.



/dev/md0:
Timing cached reads: 11148 MB in 2.00 seconds = 5578.33 MB/sec
Timing buffered disk reads: 1372 MB in 3.00 seconds = 456.84 MB/sec
/dev/bcache0:
Timing cached reads: 12564 MB in 2.00 seconds = 6286.57 MB/sec
Timing buffered disk reads: 1226 MB in 3.00 seconds = 408.66 MB/sec


Thanks!










share|improve this question
























  • I hope you understand, that what you have is a very unusual setup because the cache device is larger than the backing device. What exactly did you try to accomplish by setting up the bcache? Try dropping the bcache altogether and use the SSD directly. You will benefit from 10 times bigger storage AND much better performance.
    – Adam Ryczkowski
    Sep 12 at 16:07












  • @AdamRyczkowski oops! I fixed that typo. 14TB! Not GB...
    – Chemdream
    Sep 12 at 16:31










  • What exactly are the speeds of each of those three devices (i.e. SSD, HDD and MD0)? Do you mean sequential read or random read? Just write at least the first significant digit.
    – Adam Ryczkowski
    Sep 12 at 18:30










  • The SSD is a SAMSUNG 860 Pro. Max Sequential Read Up to 560 MBps Max Sequential Write Up to 530 MBps 4KB Random Read Random (QD1): Up to 11,000 IOPS Random (QD32): Up to 100,000 IOPS 4KB Random Write Random (QD1): Up to 43,000 IOPS Random (QD32): Up to 90,000 IOPS The 14TB's are Toshiba MG07ACA14TE. 248 MiB/s Typ. 242 MiB/s
    – Chemdream
    Sep 12 at 19:07












  • Ok, but that is only two devices - SSD i HDD. Could you also put the speed of the md0? I want to get a feeling of the degree of the slowdown you are experiencing. Also it is better to edit the question rather than posting the information in comments. Just to keep all the relevant info in one place.
    – Adam Ryczkowski
    Sep 13 at 5:35















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have 3x 14TB toshiba drives mdadm-ed (/dev/md0) raid 5'd together that are setup as a bcache. I have a 256GB fast SSD as the front of the bache.



write-back is enabled on bcache.



After a few days, the device (/dev/bcache0) becomes extremely slow. I mean like 1000th of it's normal speed.



My 2 questions are:




  • For /dev/md0, what tuning should I do for those toshiba drives? It's 4k chunks 64k blocks.


  • Is there any bcache tuning I could do?



I'm not even really sure what other info I should put here. But if you ask, I'll update this post. Thanks!



Update 1- my IOSTAT while getting 100mb/sec read, only 3mb/sec write:
https://pastebin.com/wKKf4LTq



The computer is an amd 2990wx w/32gb ram. CPU isn't the issue.



My old 3770k from 2010ish would get hard better read and write speeds than this. It's got to be some sort of setting or tuning. Thanks!



Update 2- While the system is running normally, below is the hdparm output. hdparm takes to long to run when it's not running normally.



/dev/md0:
Timing cached reads: 11148 MB in 2.00 seconds = 5578.33 MB/sec
Timing buffered disk reads: 1372 MB in 3.00 seconds = 456.84 MB/sec
/dev/bcache0:
Timing cached reads: 12564 MB in 2.00 seconds = 6286.57 MB/sec
Timing buffered disk reads: 1226 MB in 3.00 seconds = 408.66 MB/sec


Thanks!










share|improve this question















I have 3x 14TB toshiba drives mdadm-ed (/dev/md0) raid 5'd together that are setup as a bcache. I have a 256GB fast SSD as the front of the bache.



write-back is enabled on bcache.



After a few days, the device (/dev/bcache0) becomes extremely slow. I mean like 1000th of it's normal speed.



My 2 questions are:




  • For /dev/md0, what tuning should I do for those toshiba drives? It's 4k chunks 64k blocks.


  • Is there any bcache tuning I could do?



I'm not even really sure what other info I should put here. But if you ask, I'll update this post. Thanks!



Update 1- my IOSTAT while getting 100mb/sec read, only 3mb/sec write:
https://pastebin.com/wKKf4LTq



The computer is an amd 2990wx w/32gb ram. CPU isn't the issue.



My old 3770k from 2010ish would get hard better read and write speeds than this. It's got to be some sort of setting or tuning. Thanks!



Update 2- While the system is running normally, below is the hdparm output. hdparm takes to long to run when it's not running normally.



/dev/md0:
Timing cached reads: 11148 MB in 2.00 seconds = 5578.33 MB/sec
Timing buffered disk reads: 1372 MB in 3.00 seconds = 456.84 MB/sec
/dev/bcache0:
Timing cached reads: 12564 MB in 2.00 seconds = 6286.57 MB/sec
Timing buffered disk reads: 1226 MB in 3.00 seconds = 408.66 MB/sec


Thanks!







raid mdadm bcache






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 15:53









solsTiCe

5,76922046




5,76922046










asked Sep 12 at 14:15









Chemdream

338




338












  • I hope you understand, that what you have is a very unusual setup because the cache device is larger than the backing device. What exactly did you try to accomplish by setting up the bcache? Try dropping the bcache altogether and use the SSD directly. You will benefit from 10 times bigger storage AND much better performance.
    – Adam Ryczkowski
    Sep 12 at 16:07












  • @AdamRyczkowski oops! I fixed that typo. 14TB! Not GB...
    – Chemdream
    Sep 12 at 16:31










  • What exactly are the speeds of each of those three devices (i.e. SSD, HDD and MD0)? Do you mean sequential read or random read? Just write at least the first significant digit.
    – Adam Ryczkowski
    Sep 12 at 18:30










  • The SSD is a SAMSUNG 860 Pro. Max Sequential Read Up to 560 MBps Max Sequential Write Up to 530 MBps 4KB Random Read Random (QD1): Up to 11,000 IOPS Random (QD32): Up to 100,000 IOPS 4KB Random Write Random (QD1): Up to 43,000 IOPS Random (QD32): Up to 90,000 IOPS The 14TB's are Toshiba MG07ACA14TE. 248 MiB/s Typ. 242 MiB/s
    – Chemdream
    Sep 12 at 19:07












  • Ok, but that is only two devices - SSD i HDD. Could you also put the speed of the md0? I want to get a feeling of the degree of the slowdown you are experiencing. Also it is better to edit the question rather than posting the information in comments. Just to keep all the relevant info in one place.
    – Adam Ryczkowski
    Sep 13 at 5:35




















  • I hope you understand, that what you have is a very unusual setup because the cache device is larger than the backing device. What exactly did you try to accomplish by setting up the bcache? Try dropping the bcache altogether and use the SSD directly. You will benefit from 10 times bigger storage AND much better performance.
    – Adam Ryczkowski
    Sep 12 at 16:07












  • @AdamRyczkowski oops! I fixed that typo. 14TB! Not GB...
    – Chemdream
    Sep 12 at 16:31










  • What exactly are the speeds of each of those three devices (i.e. SSD, HDD and MD0)? Do you mean sequential read or random read? Just write at least the first significant digit.
    – Adam Ryczkowski
    Sep 12 at 18:30










  • The SSD is a SAMSUNG 860 Pro. Max Sequential Read Up to 560 MBps Max Sequential Write Up to 530 MBps 4KB Random Read Random (QD1): Up to 11,000 IOPS Random (QD32): Up to 100,000 IOPS 4KB Random Write Random (QD1): Up to 43,000 IOPS Random (QD32): Up to 90,000 IOPS The 14TB's are Toshiba MG07ACA14TE. 248 MiB/s Typ. 242 MiB/s
    – Chemdream
    Sep 12 at 19:07












  • Ok, but that is only two devices - SSD i HDD. Could you also put the speed of the md0? I want to get a feeling of the degree of the slowdown you are experiencing. Also it is better to edit the question rather than posting the information in comments. Just to keep all the relevant info in one place.
    – Adam Ryczkowski
    Sep 13 at 5:35


















I hope you understand, that what you have is a very unusual setup because the cache device is larger than the backing device. What exactly did you try to accomplish by setting up the bcache? Try dropping the bcache altogether and use the SSD directly. You will benefit from 10 times bigger storage AND much better performance.
– Adam Ryczkowski
Sep 12 at 16:07






I hope you understand, that what you have is a very unusual setup because the cache device is larger than the backing device. What exactly did you try to accomplish by setting up the bcache? Try dropping the bcache altogether and use the SSD directly. You will benefit from 10 times bigger storage AND much better performance.
– Adam Ryczkowski
Sep 12 at 16:07














@AdamRyczkowski oops! I fixed that typo. 14TB! Not GB...
– Chemdream
Sep 12 at 16:31




@AdamRyczkowski oops! I fixed that typo. 14TB! Not GB...
– Chemdream
Sep 12 at 16:31












What exactly are the speeds of each of those three devices (i.e. SSD, HDD and MD0)? Do you mean sequential read or random read? Just write at least the first significant digit.
– Adam Ryczkowski
Sep 12 at 18:30




What exactly are the speeds of each of those three devices (i.e. SSD, HDD and MD0)? Do you mean sequential read or random read? Just write at least the first significant digit.
– Adam Ryczkowski
Sep 12 at 18:30












The SSD is a SAMSUNG 860 Pro. Max Sequential Read Up to 560 MBps Max Sequential Write Up to 530 MBps 4KB Random Read Random (QD1): Up to 11,000 IOPS Random (QD32): Up to 100,000 IOPS 4KB Random Write Random (QD1): Up to 43,000 IOPS Random (QD32): Up to 90,000 IOPS The 14TB's are Toshiba MG07ACA14TE. 248 MiB/s Typ. 242 MiB/s
– Chemdream
Sep 12 at 19:07






The SSD is a SAMSUNG 860 Pro. Max Sequential Read Up to 560 MBps Max Sequential Write Up to 530 MBps 4KB Random Read Random (QD1): Up to 11,000 IOPS Random (QD32): Up to 100,000 IOPS 4KB Random Write Random (QD1): Up to 43,000 IOPS Random (QD32): Up to 90,000 IOPS The 14TB's are Toshiba MG07ACA14TE. 248 MiB/s Typ. 242 MiB/s
– Chemdream
Sep 12 at 19:07














Ok, but that is only two devices - SSD i HDD. Could you also put the speed of the md0? I want to get a feeling of the degree of the slowdown you are experiencing. Also it is better to edit the question rather than posting the information in comments. Just to keep all the relevant info in one place.
– Adam Ryczkowski
Sep 13 at 5:35






Ok, but that is only two devices - SSD i HDD. Could you also put the speed of the md0? I want to get a feeling of the degree of the slowdown you are experiencing. Also it is better to edit the question rather than posting the information in comments. Just to keep all the relevant info in one place.
– Adam Ryczkowski
Sep 13 at 5:35












2 Answers
2






active

oldest

votes

















up vote
0
down vote













With Samsung TLC memory, I'd stick to 512k bucket size. This will align with the page size for every 3 buckets (usually you would match the other way around but there's no sane way to align 1.5MB with any bucket size = 2^n). Use a sector size of 4k. BTW: This assumes, Samsung TLC uses 1.5MB page size but this is not officially documented somewhere. But 512k is still a safe value also for 2MB page size because it would align every 4 buckets.



Also, please align your data offset with your RAID5 setup. The bcache docs give some hints for that. It's very important to get that right. Personally, I didn't yet try such a setup but I guess [sysfs]/bdev*/partial_stripes_expensive may also be interesting in RAID-5.



I'm also guessing that the slowdowns show up when the cache has filled. You should disable discard for the cache, it's a synchronous operation for many drives due to firmware bugs. Instead, remove the bcache cdev, trim the whole partition, then resize the partition to 80-90% of its original size, align it to a 2MB boundary, and recreate bcache. Then, never touch this free partition space, it allows the drive to do background wear-leveling, discard is no longer needed then. You could create a protective partition to reserve this space, this makes it also easy to trim the reserved space.



To recreate the cache device, detach it from the backing device via sysfs, wait for completion, then unregister it, follow the steps for recreating it correctly, then attach the backing device back to the new cache. This can all be done online without reboot. But if you're not comfortable with it, make backups first.






share|improve this answer



















  • 1




    I have empirically found that echo 0 > /sys/block/bcache0/bcache/writeback_percent forces the cache to be written to disk immediatly; otherwise, you will have to wait a long time for this to happen. Then revert it back to its orignal value (10)
    – solsTiCe
    Nov 21 at 15:56












  • Good point. This is probably due to the patches limiting writeback rate to favor better throughput for requests that bypass the writeback cache. But usually, it should automatically maximize writeback rate when flushing the cache on detach. That could be a bug...
    – hurikhan77
    Nov 21 at 22:17


















up vote
0
down vote













This had to still be building or re-indexing or something. Out of no where, it started running very fast.



So anyone else that has this issue, look at your mdadm status. If it's doing anything, that might be the cause. Also, by default, it reindexes the first Sunday of every month.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1074622%2fbcache-mdadm-running-extremely-slow%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    With Samsung TLC memory, I'd stick to 512k bucket size. This will align with the page size for every 3 buckets (usually you would match the other way around but there's no sane way to align 1.5MB with any bucket size = 2^n). Use a sector size of 4k. BTW: This assumes, Samsung TLC uses 1.5MB page size but this is not officially documented somewhere. But 512k is still a safe value also for 2MB page size because it would align every 4 buckets.



    Also, please align your data offset with your RAID5 setup. The bcache docs give some hints for that. It's very important to get that right. Personally, I didn't yet try such a setup but I guess [sysfs]/bdev*/partial_stripes_expensive may also be interesting in RAID-5.



    I'm also guessing that the slowdowns show up when the cache has filled. You should disable discard for the cache, it's a synchronous operation for many drives due to firmware bugs. Instead, remove the bcache cdev, trim the whole partition, then resize the partition to 80-90% of its original size, align it to a 2MB boundary, and recreate bcache. Then, never touch this free partition space, it allows the drive to do background wear-leveling, discard is no longer needed then. You could create a protective partition to reserve this space, this makes it also easy to trim the reserved space.



    To recreate the cache device, detach it from the backing device via sysfs, wait for completion, then unregister it, follow the steps for recreating it correctly, then attach the backing device back to the new cache. This can all be done online without reboot. But if you're not comfortable with it, make backups first.






    share|improve this answer



















    • 1




      I have empirically found that echo 0 > /sys/block/bcache0/bcache/writeback_percent forces the cache to be written to disk immediatly; otherwise, you will have to wait a long time for this to happen. Then revert it back to its orignal value (10)
      – solsTiCe
      Nov 21 at 15:56












    • Good point. This is probably due to the patches limiting writeback rate to favor better throughput for requests that bypass the writeback cache. But usually, it should automatically maximize writeback rate when flushing the cache on detach. That could be a bug...
      – hurikhan77
      Nov 21 at 22:17















    up vote
    0
    down vote













    With Samsung TLC memory, I'd stick to 512k bucket size. This will align with the page size for every 3 buckets (usually you would match the other way around but there's no sane way to align 1.5MB with any bucket size = 2^n). Use a sector size of 4k. BTW: This assumes, Samsung TLC uses 1.5MB page size but this is not officially documented somewhere. But 512k is still a safe value also for 2MB page size because it would align every 4 buckets.



    Also, please align your data offset with your RAID5 setup. The bcache docs give some hints for that. It's very important to get that right. Personally, I didn't yet try such a setup but I guess [sysfs]/bdev*/partial_stripes_expensive may also be interesting in RAID-5.



    I'm also guessing that the slowdowns show up when the cache has filled. You should disable discard for the cache, it's a synchronous operation for many drives due to firmware bugs. Instead, remove the bcache cdev, trim the whole partition, then resize the partition to 80-90% of its original size, align it to a 2MB boundary, and recreate bcache. Then, never touch this free partition space, it allows the drive to do background wear-leveling, discard is no longer needed then. You could create a protective partition to reserve this space, this makes it also easy to trim the reserved space.



    To recreate the cache device, detach it from the backing device via sysfs, wait for completion, then unregister it, follow the steps for recreating it correctly, then attach the backing device back to the new cache. This can all be done online without reboot. But if you're not comfortable with it, make backups first.






    share|improve this answer



















    • 1




      I have empirically found that echo 0 > /sys/block/bcache0/bcache/writeback_percent forces the cache to be written to disk immediatly; otherwise, you will have to wait a long time for this to happen. Then revert it back to its orignal value (10)
      – solsTiCe
      Nov 21 at 15:56












    • Good point. This is probably due to the patches limiting writeback rate to favor better throughput for requests that bypass the writeback cache. But usually, it should automatically maximize writeback rate when flushing the cache on detach. That could be a bug...
      – hurikhan77
      Nov 21 at 22:17













    up vote
    0
    down vote










    up vote
    0
    down vote









    With Samsung TLC memory, I'd stick to 512k bucket size. This will align with the page size for every 3 buckets (usually you would match the other way around but there's no sane way to align 1.5MB with any bucket size = 2^n). Use a sector size of 4k. BTW: This assumes, Samsung TLC uses 1.5MB page size but this is not officially documented somewhere. But 512k is still a safe value also for 2MB page size because it would align every 4 buckets.



    Also, please align your data offset with your RAID5 setup. The bcache docs give some hints for that. It's very important to get that right. Personally, I didn't yet try such a setup but I guess [sysfs]/bdev*/partial_stripes_expensive may also be interesting in RAID-5.



    I'm also guessing that the slowdowns show up when the cache has filled. You should disable discard for the cache, it's a synchronous operation for many drives due to firmware bugs. Instead, remove the bcache cdev, trim the whole partition, then resize the partition to 80-90% of its original size, align it to a 2MB boundary, and recreate bcache. Then, never touch this free partition space, it allows the drive to do background wear-leveling, discard is no longer needed then. You could create a protective partition to reserve this space, this makes it also easy to trim the reserved space.



    To recreate the cache device, detach it from the backing device via sysfs, wait for completion, then unregister it, follow the steps for recreating it correctly, then attach the backing device back to the new cache. This can all be done online without reboot. But if you're not comfortable with it, make backups first.






    share|improve this answer














    With Samsung TLC memory, I'd stick to 512k bucket size. This will align with the page size for every 3 buckets (usually you would match the other way around but there's no sane way to align 1.5MB with any bucket size = 2^n). Use a sector size of 4k. BTW: This assumes, Samsung TLC uses 1.5MB page size but this is not officially documented somewhere. But 512k is still a safe value also for 2MB page size because it would align every 4 buckets.



    Also, please align your data offset with your RAID5 setup. The bcache docs give some hints for that. It's very important to get that right. Personally, I didn't yet try such a setup but I guess [sysfs]/bdev*/partial_stripes_expensive may also be interesting in RAID-5.



    I'm also guessing that the slowdowns show up when the cache has filled. You should disable discard for the cache, it's a synchronous operation for many drives due to firmware bugs. Instead, remove the bcache cdev, trim the whole partition, then resize the partition to 80-90% of its original size, align it to a 2MB boundary, and recreate bcache. Then, never touch this free partition space, it allows the drive to do background wear-leveling, discard is no longer needed then. You could create a protective partition to reserve this space, this makes it also easy to trim the reserved space.



    To recreate the cache device, detach it from the backing device via sysfs, wait for completion, then unregister it, follow the steps for recreating it correctly, then attach the backing device back to the new cache. This can all be done online without reboot. But if you're not comfortable with it, make backups first.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 21 at 15:44

























    answered Nov 21 at 15:32









    hurikhan77

    888




    888








    • 1




      I have empirically found that echo 0 > /sys/block/bcache0/bcache/writeback_percent forces the cache to be written to disk immediatly; otherwise, you will have to wait a long time for this to happen. Then revert it back to its orignal value (10)
      – solsTiCe
      Nov 21 at 15:56












    • Good point. This is probably due to the patches limiting writeback rate to favor better throughput for requests that bypass the writeback cache. But usually, it should automatically maximize writeback rate when flushing the cache on detach. That could be a bug...
      – hurikhan77
      Nov 21 at 22:17














    • 1




      I have empirically found that echo 0 > /sys/block/bcache0/bcache/writeback_percent forces the cache to be written to disk immediatly; otherwise, you will have to wait a long time for this to happen. Then revert it back to its orignal value (10)
      – solsTiCe
      Nov 21 at 15:56












    • Good point. This is probably due to the patches limiting writeback rate to favor better throughput for requests that bypass the writeback cache. But usually, it should automatically maximize writeback rate when flushing the cache on detach. That could be a bug...
      – hurikhan77
      Nov 21 at 22:17








    1




    1




    I have empirically found that echo 0 > /sys/block/bcache0/bcache/writeback_percent forces the cache to be written to disk immediatly; otherwise, you will have to wait a long time for this to happen. Then revert it back to its orignal value (10)
    – solsTiCe
    Nov 21 at 15:56






    I have empirically found that echo 0 > /sys/block/bcache0/bcache/writeback_percent forces the cache to be written to disk immediatly; otherwise, you will have to wait a long time for this to happen. Then revert it back to its orignal value (10)
    – solsTiCe
    Nov 21 at 15:56














    Good point. This is probably due to the patches limiting writeback rate to favor better throughput for requests that bypass the writeback cache. But usually, it should automatically maximize writeback rate when flushing the cache on detach. That could be a bug...
    – hurikhan77
    Nov 21 at 22:17




    Good point. This is probably due to the patches limiting writeback rate to favor better throughput for requests that bypass the writeback cache. But usually, it should automatically maximize writeback rate when flushing the cache on detach. That could be a bug...
    – hurikhan77
    Nov 21 at 22:17












    up vote
    0
    down vote













    This had to still be building or re-indexing or something. Out of no where, it started running very fast.



    So anyone else that has this issue, look at your mdadm status. If it's doing anything, that might be the cause. Also, by default, it reindexes the first Sunday of every month.






    share|improve this answer

























      up vote
      0
      down vote













      This had to still be building or re-indexing or something. Out of no where, it started running very fast.



      So anyone else that has this issue, look at your mdadm status. If it's doing anything, that might be the cause. Also, by default, it reindexes the first Sunday of every month.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        This had to still be building or re-indexing or something. Out of no where, it started running very fast.



        So anyone else that has this issue, look at your mdadm status. If it's doing anything, that might be the cause. Also, by default, it reindexes the first Sunday of every month.






        share|improve this answer












        This had to still be building or re-indexing or something. Out of no where, it started running very fast.



        So anyone else that has this issue, look at your mdadm status. If it's doing anything, that might be the cause. Also, by default, it reindexes the first Sunday of every month.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 28 at 13:55









        Chemdream

        338




        338






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1074622%2fbcache-mdadm-running-extremely-slow%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?