Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Nanobsd and compact flash

    Scheduled Pinned Locked Moved Hardware
    9 Posts 4 Posters 4.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      demco
      last edited by

      For pfsense nanobsd. What is the typical writing speed for a compact flash?

      Running pfsense 2.1 amd64 nanobsd on a CF card (Kingston elite pro 133x), writing to the CF card is slow (below 1 MBps).

      • iostat output
              ad0
        KB/t tps  MB/s
        4.00 222  0.87
        4.00 144  0.56
        4.00 158  0.62
        4.00 124  0.48
        4.00 218  0.85

      With the same hardware, but running pfsense 2.1 full install from a harddisk. Writing to the same CF card, slightly better. (the CF card on Win 7 with usb reader, FAT32, can get 15MBps)

      • iostat output
                ad0
        KB/t    tps  MB/s
        120.71  17  2.00
        123.87  30  3.63
        124.46  35  4.25
        124.12  32  3.87
        115.60  20  2.26

      Seems like running nanobsd, it is limited to 4KB/t (happen also on other model of boards).

      Any insight on what maybe causing the slow writing speed?

      1 Reply Last reply Reply Quote 0
      • J
        jasonlitka
        last edited by

        The measurements are meaningless unless the system was trying to perform the same task during each sample. NanoBSD is explicitly designed to not write very much to disk so I'd expect the numbers to be lower than a full install.

        I can break anything.

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          In the standard nanobsd images DMA is disabled so it doesn't matter how fast the card claims to be it will only be running at PIO speed. It is disabled because in many CF-IDE adapters the required connections for running DMA are missing and that causes it to fail to boot. If your adapter has those connections you can try re-enabling DMA by editing /boot/loader.conf appropriately.

          Nice explanation here: http://www.fccps.cz/download/adv/frr/cf.html

          Steve

          1 Reply Last reply Reply Quote 0
          • D
            demco
            last edited by

            @Jason:

            The measurements are meaningless unless the system was trying to perform the same task during each sample. NanoBSD is explicitly designed to not write very much to disk so I'd expect the numbers to be lower than a full install.

            When comparing the nanobsd & full install pfsense. I download file from ftp server on the LAN, it is a 100Mbps connection (max out at around 11MB/s).

            @stephenw10:

            In the standard nanobsd images DMA is disabled so it doesn't matter how fast the card claims to be it will only be running at PIO speed. It is disabled because in many CF-IDE adapters the required connections for running DMA are missing and that causes it to fail to boot. If your adapter has those connections you can try re-enabling DMA by editing /boot/loader.conf appropriately.

            Nice explanation here: http://www.fccps.cz/download/adv/frr/cf.html

            Steve

            Seem like DMA is already enabled. sysctl show

            hw.ata.wc: 1
            hw.ata.atapi_dma: 1
            hw.ata.ata_dma_check_80pin: 1
            hw.ata.ata_dma: 1

            dmesg show

            ad0: 7647MB <elite 20120410="" pro="" cf="" card="" 8gb="">at ata0-master UDMA66
            ad4: 476940MB <st500dm002 1bd142="" kc45="">at ata2-master UDMA100 SATA 3Gb/s

            Turn off DMA just to experiment,

            sysctl:
            hw.ata.wc: 0
            hw.ata.atapi_dma: 0
            hw.ata.ata_dma: 0

            dmesg:
            ad0: 7647MB <elite 20120410="" pro="" cf="" card="" 8gb="">at ata0-master PIO4
            ad4: 476940MB <st500dm002 1bd142="" kc45="">at ata2-master PIO4 SATA 3Gb/s

            Not much difference writing to CF card
                ad0
            KB/t  tps  MB/s
            4.00 166  0.65
            4.00 166  0.65
            4.00 163  0.64
            4.00 122  0.48
            4.00 168  0.66

            Significant when writing to a harddisk (this is on a nanobsd system)

            ad4 (DMA on)              ad4 (DMA off)
            KB/t      tps MB/s          KB/t    tps  MB/s
            128.00  90 11.26        128.00  39  4.83
            128.00  90 11.24        128.00  39  4.83
            126.77  90 11.16        128.00  38  4.74
            128.00  90 11.26        128.00  39  4.84
            128.00  89 11.14        128.00  39  4.83

            Any setting to improve the CF card performance?

            Thanks.</st500dm002></elite></st500dm002></elite>

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              Interesting. Is that the standard nano image or nano-vga?

              Steve

              1 Reply Last reply Reply Quote 0
              • D
                demco
                last edited by

                @stephenw10:

                Interesting. Is that the standard nano image or nano-vga?

                Steve

                nano-vga image.

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  Ah. Nano-VGA was originally produced for a specific box that wouldn't boot at all if DMA was disabled.

                  No idea why it's so slow then. My own nano installs are also dog slow but I always assumed it was because DMA was disabled or the cards were just slow.

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • S
                    Steve Evans
                    last edited by

                    @stephenw10:

                    In the standard nanobsd images DMA is disabled so it doesn't matter how fast the card claims to be it will only be running at PIO speed. It is disabled because in many CF-IDE adapters the required connections for running DMA are missing and that causes it to fail to boot. If your adapter has those connections you can try re-enabling DMA by editing /boot/loader.conf appropriately.

                    Nice explanation here: http://www.fccps.cz/download/adv/frr/cf.html

                    Steve

                    Hi Steve,

                    You may recall my post HERE about adding a hard disk to my X750e to provide storage for the proxy cache, and the rather poor disk IO rates of ~4.5MBytes/sec. Reading this post I saw the same performance being quoted for PIO access to disk.

                    So, you can guess what's coming…

                    Do you know if the Watchguard boxes will support IDE DMA to/from CF, and if so, how do you turn it on? That should improve boot time.

                    How can I turn on DMA for the hard disk, (a) together with CF DMA support if it's supported, or (b) independently if the CF won't support DMA?

                    By all means post the response in the thread referenced above so you can rightfully claim the credit for any speed increase there. :)

                    Thanks,

                    Steve

                    1 Reply Last reply Reply Quote 0
                    • D
                      demco
                      last edited by

                      An update for future reference.

                      Slow write speed was due to nanobsd mount filesystem in synchronous mode. Can achieve 4MBps once mounted as asynchronous (remove the sync option from mount commands).

                      Looks like for now it is a choice between resilient filesystem or fast filesystem.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.