Announcement

Collapse
No announcement yet.

Comparison of Ext4 and Btrfs

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Comparison of Ext4 and Btrfs

    The benefits of Btrfs have been promoted on this forum here by oshunluvr and others. I was interested to see how it performed on my experimental desktop which is a Compaq AiO desktop with an AMD E350 Dual-Core 1.6GHz processor. I have replaced the disc by a 256 GiB SSD. Not a very fast computer but I had been finding that Zesty updates since the pre-Alpha phase had improved its performance. In my opinion Zesty is in great shape.

    I decided to do the comparison by timing Kdenlive Rendering a video. This process involves disc I/O and lots of processing. I installed Zesty with separate / and /home partitions. One installation was with Ext4 partitions and I then did the Rendering. Following this I then installed Zesty with Btrfs partitions of the same size and repeated the Rendering. The results in the table below show little difference in performance

    File System Time H:MM:SS
    Ext4 1:00:50
    Btrfs 1:00:40
    I had to redo the reinstallation process several times as I learnt to make sure there was no major process using system resources and that Kdenive had all its thumbnails loaded. I also found that the spare space in the two partitions was greater with Btrfs. For example the /home spare space with Ext4 was 82.4 GiB and 96.3 GiB for Btrfs.

    With the Ext4 file system, the processing load from KSysGuard stayed close to 100% and this level includes the component from KSysGuard. By comparison the Btrfs file system was less at about 80%.

    A recent comparison on the Internet to determine the difference between Ext4 and Btrfs can be found here. The bottom line was

    "Btrfs is definitely worth looking into, but a complete switch to replace ext4 on desktop Linux might be a few years away."

    My feeling is that if your are a lover of command line entries for using the full resources of Btrfs you should definitely try it out. On the other hand, if you prefer to stay at the GUI level, then Ext4 is for you.

    I firmly believe that for Kubuntu to be acceptable to more people, the need to use the command line should not be required. Therefore Btrfs features should be provided by a GUI interface.

    #2
    Nice writeup, NoWorries!
    Did you set up your Zesty to select deadline for SSDs and cfq for rotational drives?

    I agree with your assessment that Btrfs needs a GUI app. In fact, I just installed the Qt 5.8.0 SDK and I'm going to play around with writing one, at least for the things I do.

    P.S. -- deadline works best on SSDs (and USB sticks, I assume). I recently installed Neon on a 16GB USB stick, using Btrfs as the fs, to make a "persistant" system. Booting it up it ran reasonably well once the desktop displayed. I could mount my sda1 Btfs and play with it.

    P.S.- After reading that article, which was two years old, the author does a fair job comparing their speeds, but nothing else. Also, he's using Mint which requires Btrfs-tools to be installed on the installation USB stick (Can't do it on a DVD) before the Btrfs can be chosen. Kubuntu comes with Btrfs tools installed on the LiveUSB (or DVD) and Btrfs can be selected during the install.

    Also, the author sums up Btrfs fairly well:
    Even though transfer rates are important (Who wants to wait for files to copy?), there is more to a file system than the speed of file transfers. Btrfs has many good features. Copy-on-Write, snapshots, extensive checksums, scrubbing, deduplication, self-healing data, and many more useful improvements ensure data integrity. Btrfs lacks the RAID-Z features of ZFS, so RAID is still in the experimental state with Btrfs. However, for pure data storage, Btrfs is the winner over ext4, but time will tell.
    but then recommends the less powerful fs because a "noob" won't be able to use the CLI. Being two years old the article's info about Btrfs support of RAID is lacking.

    It wouldn't surprise me if Ubuntu developers (or Debian or Kubuntu) are working on GUI Btrfs tools as we write, with plans of making Btrfs the default fs. Imagine a gui config tool in SystemSettings which automatically mounts /dev/sdx1 (or whatever) to /mnt and creates backup ro snapshots at /mnt/backups, deletes older backup snapshots, and umounts /mnt, all in the background without user interactions. Then, in the Grub menu, an option to restore to a particular user selectable snapshot, defaulting to the most recent.

    [#]BTRFS
    [/#]
    Last edited by GreyGeek; Sep 22, 2017, 12:00 PM.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      As far as btrfs RAID features, I'd still say there's work to be done - RAID10 isn't really RAID10 and RAID6 wasn't working - at least last I checked. Even so, I'm super-glad to have put mdadm into the past. I think the error recovery tools still could use some help, but at least they're there.

      Re. the io-scheduler's; it looks like file system type has a significant impact on scheduler performance and I've been able to find zero data on BTRFS and the schedulers.

      I would love a truly functional BTRFS GUI tool. There was one being worked on but it seems to have been abandoned in 2012. I was pleased to see KPartition Manager finally recognizes btrfs file systems at least.

      Let see - brain storming Jerry's "features" list:
      • File system Manager
        • Scan
        • DF

      • Snapshot Manager
        • Auto snapshot management
        • Rollback management

      • Backup Manager (Full and Incremental )
        • Send|Receive

      • Device Manager
        • Adding/Removing devices
        • Balance functions

      • Error checking and repair
        • Data recovery


      That's a good start - should keep you busy for a week or two!

      Please Read Me

      Comment


        #4
        Thanks for the system analysis, Oshunluver!
        You saved me weeks of thinking!

        PS- I copied your list of features and am making them my first goal!
        Last edited by GreyGeek; Apr 10, 2017, 01:05 PM.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Originally posted by GreyGeek View Post
          Nice writeup, NoWorries!
          Did you set up your Zesty to select deadline for SSDs and cfq for rotational drives?
          Glad you appreciated the writeup.

          I did not do any settings for Btrfs. I do not know the commands to activate deadline for SSDs as I assumed that would be done in the installation. I just installed it with separate / and /home partitions. I do not have any rotational drives on any of my Desktop/Laptop computers - they each have an SSD. All three of my computers are networked and have essentially the same files which are copied over an Ethernet link. I am fortunate to be on our NBN fibre network and I only use wireless as a last resort.

          Comment


            #6
            Deadline is the current default io-scheduler. BTRFS has many mount options as one would expect. I only use noatime, space_cache, and compression=lzo. There are others that can improve performance like nodatacow. There is an "ssd" option but it is enabled automatically if /sys/block/sdX/queue/rotational=0.
            Last edited by oshunluvr; Apr 11, 2017, 05:44 AM.

            Please Read Me

            Comment


              #7
              If you use nodatacow you'll lose compression!
              noatime makes sense if you don't want a search or other massive read command to update the last access time and force a massive COW to a snapshot. That would really lag the system, as if your snapshot was -r.


              Sent from my iPhone using Tapatalk
              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
              – John F. Kennedy, February 26, 1962.

              Comment


                #8
                Re. noatime: Going a step further this article https://lwn.net/Articles/499293/ explains that atime can actually significantly increase space usage and drastically increase drive activity because a simple "read" operation of a snapshot will generate a file change from BTRFSs point of view, so all the snapshot-ed files will be duplicated from a simple read operation. Not good.

                nodatacow is probably not a good idea. Not only does it turn off compression, it also turns off datachecksum. It's only sensible during random writes to large database files. The other potential use is when using virtual drives (like with VirtualBox). My preference was to create an ext4 partition and host my VBox drives there instead. Seemed safer and more reasonable.

                Please Read Me

                Comment


                  #9
                  Where does zesty place teh swap file on brtfs setups?

                  Comment


                    #10
                    Originally posted by mr_raider View Post
                    Where does zesty place teh swap file on brtfs setups?
                    AFAIK, all versions of Kubuntu use a swap partition, not a file. If you really need to use a swap file for some reason, you would have to use nodatacow on the file system it resided on. Not the most optimal set up to say the least.

                    Please Read Me

                    Comment


                      #11
                      Originally posted by oshunluvr View Post
                      AFAIK, all versions of Kubuntu use a swap partition, not a file. If you really need to use a swap file for some reason, you would have to use nodatacow on the file system it resided on. Not the most optimal set up to say the least.
                      The default behavior for 17.04 in ext4 is to create a swap file.

                      Sent from my ZTE A2017U using Tapatalk

                      Comment


                        #12
                        should I add a :noatime: option to this (from my fstab)

                        Code:
                        #TB-drive
                        /dev/sdb1 /mnt/btrfs    btrfs     rw,relatime,space_cache,compress=lzo     0    0
                        VINNY
                        i7 4core HT 8MB L3 2.9GHz
                        16GB RAM
                        Nvidia GTX 860M 4GB RAM 1152 cuda cores

                        Comment


                          #13
                          Originally posted by mr_raider View Post
                          The default behavior for 17.04 in ext4 is to create a swap file.

                          Sent from my ZTE A2017U using Tapatalk
                          OK, that's new. I'll try a VM install using btrfs and report back.

                          Please Read Me

                          Comment


                            #14
                            Originally posted by vinnywright View Post
                            should I add a :noatime: option to this (from my fstab)

                            Code:
                            #TB-drive
                            /dev/sdb1 /mnt/btrfs    btrfs     rw,relatime,space_cache,compress=lzo     0    0
                            VINNY
                            BTRFS guys say use noatime. I've been using relatime until recently when I read that. I can't say I've seen any difference and you might not most of the time. It seems to mostly effect snapshots (causing them to artificially expand) so if you don't keep a lot of them around or keep them for long, you might not even notice.

                            Please Read Me

                            Comment


                              #15
                              Originally posted by oshunluvr View Post
                              OK, that's new. I'll try a VM install using btrfs and report back.
                              I wasn't thinking: The default install uses ext4, not btrfs, so it wouldn't matter. You have to choose manual to get btrfs, so I make a swap partition if I need one. I'm doing a new install without building a swap partition first. Let's see what it does.

                              Please Read Me

                              Comment

                              Working...
                              X