I already once wrote about this topic at the Silent Fanless FreeBSD Desktop/Server article. To my pleasant surprise BSD NOW Episode 253: Silence of the Fans featured my article for which I am very grateful. Today I would like to show another practical example of such setup and with more hands on approach along with real power usage measurements with power meter. I also got more power efficient ASRock N3150B-ITX motherboard with only 6W TDP which includes 4-core Celeron N3150 CPU and also nice small Supermicro SC101i Mini ITX case. Keep in mind that ASRock also made very similar N3150-ITX motherboard (no ‘B’ in model name) with different ports/connectors that may better suit your needs better.

You may also check the follow up Silent Fanless FreeBSD Server – Redundant Backup article.

Build

Here is how the Supermicro SC101i case looks like with ASRock N3150B-ITX motherboard installed.

One thing that surprised me very much was the hard disk cost. The internal Seagate 4TB ST4000LM024 2.5 SATA drive costs about $180-190 but the same disk sold as Maxtor M3 4TB 2.5 disk in external case with Maxtor brand (which is owned by Seagate anyway) and USB 3.0 port costs half of that – about $90-100. At least in Europe/Poland location.

I think you do already know where I am going with my thoughts. I will use an external Maxtor M3 4TB 2.5 drive and connect it via the USB 3.0 port in this setup. While SATA III provides theoretical throughput of 6Gbps the USB 3.0 provides 5Gbps theoretical throughput. The difference can be important for low latency high throughput SSD drives that approach 580MB/s speed but not for traditional rotational disks moving gently at 5400RPM.

The maximum performance I was able to squeeze from this Maxtor M3 4TB 2.5 USB 3.0 drive was 90MB/s write speed and 120MB/s read speed using pv(1) tool, and that was at the beginning of the disk. These speeds will drop to about 70MB/s and 90MB/s at the end of the disk respectively for write and read operations. We are not even approaching SATA I standard here which tops at 1.5Gbps. Thus it will not make a difference or not a significant one for sure for such storage.

At first I wanted to make a hole on the motherboard end steel plate (somewhere beside the back ports) with drill to get outside with USB cable from the case and attach it to one of the USB 3.0 ports at the back of the motherboard but fortunately I got better idea. This motherboard has connector for internal USB 3.0 (so called front panel USB on the case) so I bought Akyga AK-CA-57 front panel cable with USB 3.0 port and connected everything inside the case.

This is the Akyga AK-CA-57 USB 3.0 cable.

If I was going to install two USB 3.0 disks using this method I would use one of these cables instead:

The only problem can be more physical one – will it blend will it fit? Fortunately I was able to find a way to fit it in the case and there is even space for the second disk. As this will be my offsite backup replacement which is only 3rd stage/offsite backup I do not need to create redundant mirror/RAID1 protection but it’s definitely possible with two Maxtor M3 4TB 2.5 USB 3.0 drives.

The opened Supermicro SC101i case with ASRock N3150B-ITX motherboard inside and attached Pico PSU looks like that.

With attached Akyga AK-CA-57 USB 3.0 cable things get little narrow, but with proper cable lay you will still be able to fit another internal 2.5 SATA disk or external 2.5 USB 3.0 disk.

I attached Akyga AK-CA-57 cable to this USB 3.0 connector on the motherboard.

Case with Maxtor M3 4TB disk. The disk placement required little modifications.

I created custom disk holders using steel plates I got from window mosquito net set for my home but you should be able to get something similar in any hardware shop. I modified them a little with pliers.

I also ‘silenced’ the disk vibrations with felt stickers.

The silenced disk in the Supermicro SC101i case.

Ancestor

Before this setup I used Raspberry Pi 2B with external Western Digital 2TB 2.5 USB 3.0 disk but the storage space requirements become larger so I needed to increase that. It was of course with GELI encryption and ZFS with enabled LZ4 compression on top. The four humble ARM32 cores and soldered 1GB of RAM was able to squeeze whooping 5MB/s read/write experience from this ZFS/GELI setup but that was not hurting me as I used rsync(1) for differential backups and the Internet connection to that box was limited to about 1.5MB/s. I would still use that setup but it just won’t boot with that larger Maxtor M3 4TB disk because it requires more power and I already used stronger 5V 3.1A charger then 5V 2.0A suggested by vendor. Even the safe_mode_gpio=4 and max_usb_current=1 options at /boot/msdos/config.txt did not help.

Cost

The complete setup price tops at $220 total. Here are the parts used.

PRICE COMPONENT $59 CPU/Motherboard ASRock N3150B-ITX Mini-ITX $14 RAM Crucial 4GB DDR3L 1.35V $13 PSU 12V 7.5A 90W Pico (internal) $2 PSU 12V 2.5A 30W Leader Electronics (external) $29 Supermicro SC101i (used) $3 Akyga AK-CA-57 USB 3.0 Cable $3 SanDisk Fit 16GB USB 2.0 Drive (system) $95 Maxtor M3 4TB 2.5 USB 3.0 Drive (data) $220 TOTAL

PSU

In earlier Silent Fanless FreeBSD Desktop/Server article I used quite large 90W PSU from FSP Group. From the PSUs that I owned only ThinkPad W520/W530 bricks can compete in size with this beast. As this motherboard will use very little power (details lower) it will require a lot smaller PSU. As the FSP Group PSU has IEC C14 slot it also requires additional IEC C13 power cable which makes it even bigger solution. The new 12V 2.5A 30W is very compact and also costs fraction of the 90W FSP Group gojira.

New Leader Electronics PSU label.

Below you can see the comparison for yourself.

I also got cheaper and less powerful Pico PSU which now tops as 12V 7.5A 90W power.

Power Consumption

This is where it gets really interesting. I measured the power consumption with power meter.

Idle

When this box is booted without any media attached it uses only 7.5W of power idling. While the system was idle with SanDisk 16GB USB 2.0 drive (on which FreeBSD was installed) it used about 8.0W of power. When booted with Maxtor M3 4TB disk inside and SanDisk 16GB USB 2.0 drive attached it run idle at about 8.5W of power.

Load

As I do not need full CPU speed I limited the CPU speed in powerd(8) options to 1.2Ghz. With this limit set the fully loaded system with all 4 cores busy at 100% and two dd(8) processes for read both boot SanDisk 16GB drive and Maxtor M3 4TB disk and with GELI enabled ZFS pool doing scrub operation in progress and additional two find(1) processes for both disks it would not pass the 13.9W barrier. Without CPU limitation (that means Intel Turbo Boost enabled) the system used 16.0W of power at most.

Summary of power usage for this box.

POWER TYPE CONFIGURATION 7.5 W IDLE System 8.0 W IDLE System + SanDisk 16GB drive 8.5 W IDLE System + SanDisk 16GB drive + Maxtor M3 4TB drive + CPU 1.2 Ghz limit 8.5 W IDLE System + SanDisk 16GB drive + Maxtor M3 4TB drive 13.9 W LOAD System + SanDisk 16GB drive + Maxtor M3 4TB drive + CPU 1.2 Ghz limit 16.0 W LOAD System + SanDisk 16GB drive + Maxtor M3 4TB drive

For comparision the Raspberry Pi 2B with 16GB MicroSD card attached used only 1.5W but we all know how slow it is. When used with Western Digital 2TB 2.5 USB 3.0 drive it used about 2.2W at idle state.

Configuration for Low Power Consumption

Below are FreeBSD configuration files used in this box to lower the power consumption.

The /etc/sysctl.conf file.

# ANNOYING THINGS vfs.usermount=1 kern.coredump=0 hw.syscons.bell=0 kern.vt.enable_bell=0 # LIMIT ZFS ARC EFFICIENTLY kern.maxvnodes=32768 # ALLOW UPGRADES IN JAILS security.jail.chflags_allowed=1 # ALLOW RAW SOCKETS IN JAILS security.jail.param.allow.raw_sockets=1 security.jail.allow_raw_sockets=1 # RANDOM PID kern.randompid=12345 # PERFORMANCE/ALL SHARED MEMORY SEGMENTS WILL BE MAPPED TO UNPAGEABLE RAM kern.ipc.shm_use_phys=1 # MEMORY OVERCOMMIT SEE tuning(7) vm.overcommit=2 # NETWORK/DO NOT SEND RST ON SEGMENTS TO CLOSED PORTS net.inet.tcp.blackhole=2 # NETWORK/DO NOT SEND PORT UNREACHABLES FOR REFUSED CONNECTS net.inet.udp.blackhole=1 # NETWORK/ENABLE SCTP BLACKHOLING blackhole(4) FOR MORE DETAILS net.inet.sctp.blackhole=1 # NETWORK/MAX SIZE OF AUTOMATIC RECEIVE BUFFER (2097152) [4x] net.inet.tcp.recvbuf_max=8388608 # NETWORK/MAX SIZE OF AUTOMATIC SEND BUFFER (2097152) [4x] net.inet.tcp.sendbuf_max=8388608 # NETWORK/MAXIMUM SOCKET BUFFER SIZE (5242880) [3.2x] kern.ipc.maxsockbuf=16777216 # NETWORK/MAXIMUM LISTEN SOCKET PENDING CONNECTION ACCEPT QUEUE SIZE (128) [8x] kern.ipc.soacceptqueue=1024 # NETWORK/DEFAULT tcp MAXIMUM SEGMENT SIZE (536) [2.7x] net.inet.tcp.mssdflt=1460 # NETWORK/MINIMUM TCP MAXIMUM SEGMENT SIZE (216) [6x] net.inet.tcp.minmss=1300 # NETWORK/LIMIT ON SYN/ACK RETRANSMISSIONS (3) net.inet.tcp.syncache.rexmtlimit=0 # NETWORK/USE TCP SYN COOKIES IF THE SYNCACHE OVERFLOWS (1) net.inet.tcp.syncookies=0 # NETWORK/ENABLE TCP SEGMENTATION OFFLOAD (1) net.inet.tcp.tso=0 # NETWORK/ENABLE IP OPTIONS PROCESSING ([LS]SRR, RR, TS) (1) net.inet.ip.process_options=0 # NETWORK/ASSIGN RANDOM ip_id VALUES (0) net.inet.ip.random_id=1 # NETWORK/ENABLE SENDING IP REDIRECTS (1) net.inet.ip.redirect=0 # NETWORK/IGNORE ICMP REDIRECTS (0) net.inet.icmp.drop_redirect=1 # NETWORK/ASSUME SO_KEEPALIVE ON ALL TCP CONNECTIONS (1) net.inet.tcp.always_keepalive=0 # NETWORK/DROP TCP PACKETS WITH SYN+FIN SET (0) net.inet.tcp.drop_synfin=1 # NETWORK/RECYCLE CLOSED FIN_WAIT_2 CONNECTIONS FASTER (0) net.inet.tcp.fast_finwait2_recycle=1 # NETWORK/CERTAIN ICMP UNREACHABLE MESSAGES MAY ABORT CONNECTIONS IN SYN_SENT (1) net.inet.tcp.icmp_may_rst=0 # NETWORK/MAXIMUM SEGMENT LIFETIME (30000) [0.27x] net.inet.tcp.msl=8192 # NETWORK/ENABLE PATH MTU DISCOVERY (1) net.inet.tcp.path_mtu_discovery=0 # NETWORK/EXPIRE TIME OF TCP HOSTCACHE ENTRIES (3600) [2x] net.inet.tcp.hostcache.expire=7200 # NETWORK/TIME BEFORE DELAYED ACK IS SENT (100) [0.2x] net.inet.tcp.delacktime=20

The /boot/loader.conf file.

# BOOT OPTIONS autoboot_delay=1 boot_mute=YES # MODULES FOR BOOT zfs_load=YES # DISABLE HYPER THREADING machdep.hyperthreading_allowed=0 # REDUCE NUMBER OF SOUND GENERATED INTERRUPTS hw.snd.latency=7 # RACCT/RCTL RESOURCE LIMITS kern.racct.enable=1 # PIPE KVA LIMIT | 320 MB kern.ipc.maxpipekva=335544320 # NUMBER OF SEGMENTS PER PROCESS kern.ipc.shmseg=1024 # LARGE PAGE MAPPINGS vm.pmap.pg_ps_enabled=1 # SHARED MEMORY kern.ipc.shmmni=1024 kern.ipc.shmseg=1024 # ZFS TUNING vfs.zfs.prefetch_disable=1 vfs.zfs.cache_flush_disable=1 vfs.zfs.vdev.cache.size=16M vfs.zfs.arc_min=32M vfs.zfs.arc_max=128M vfs.zfs.txg.timeout=1 # NETWORK MAX SEND QUEUE SIZE net.link.ifqmaxlen=2048 # POWER OFF DEVICES WITHOUT ATTACHED DRIVER hw.pci.do_power_nodriver=3 # AHCI POWER MANAGEMENT FOR EVERY USED CHANNEL (ahcich 0-7) hint.ahcich.0.pm_level=5 hint.ahcich.1.pm_level=5 hint.ahcich.2.pm_level=5 hint.ahcich.3.pm_level=5 hint.ahcich.4.pm_level=5 hint.ahcich.5.pm_level=5 hint.ahcich.6.pm_level=5 hint.ahcich.7.pm_level=5 # GELI THREADS kern.geom.eli.threads=2 kern.geom.eli.batch=1

The /etc/rc.conf file.

# NETWORK hostname=offsite.local background_dhclient=YES extra_netfs_types=NFS defaultroute_delay=3 defaultroute_carrier_delay=3 # MODULES/COMMON/BASE kld_list="${kld_list} aesni geom_eli" kld_list="${kld_list} fuse coretemp sem cpuctl ichsmb cc_htcp" kld_list="${kld_list} libiconv cd9660_iconv msdosfs_iconv udf_iconv" # POWER performance_cx_lowest=C1 economy_cx_lowest=Cmax powerd_enable=YES powerd_flags="-n adaptive -a hiadaptive -b adaptive -m 400 -M 1200" # DAEMONS | yes zfs_enable=YES nfs_client_enable=YES syslogd_flags='-s -s' sshd_enable=YES # DAEMONS | no sendmail_enable=NONE sendmail_submit_enable=NO sendmail_outbound_enable=NO sendmail_msp_queue_enable=NO # FS fsck_y_enable=YES clear_tmp_enable=YES clear_tmp_X=YES growfs_enable=YES # OTHER keyrate=fast font8x14=vgarom-8x14 virecover_enable=NO update_motd=NO devfs_system_ruleset=desktop hostid_enable=NO

USB Boot Drive

I was not sure if I should use USB 2.0 drive or USB 3.0 drive for FreeBSD system so I got both versions from SanDisk and tested their performance with pv(1) and diskinfo(8) tools. The pv(1) utility had options enabled shown below and for diskinfo(8) the -c and -i parameters were used.

% which pv pv: aliased to pv -t -r -a -b -W -B 1048576

The dmesg(8) information for the SanDisk Fit USB 2.0 16GB drive.

# dmesg | tail -6 da0 at umass-sim0 bus 0 scbus3 target 0 lun 0 da0: Removable Direct Access SPC-4 SCSI device da0: Serial Number 4C530001100609104091 da0: 40.000MB/s transfers da0: 15060MB (30842880 512 byte sectors) da0: quirks=0x2

The dmesg(8) information for the SanDisk Fit USB 3.0 16GB drive.

# dmesg | tail -6 da0 at umass-sim0 bus 0 scbus3 target 0 lun 0 da0: Removable Direct Access SPC-4 SCSI device da0: Serial Number 4C530 001070202100093 da0: 40.000MB/s transfers da0: 14663MB (30031250 512 byte sectors) da0: quirks=0x2

There is also noticeable size difference as the USB 2.0 version has additional 400 MB of space!

By the way … the SanDisk Fit USB 3.0 16GB came with this sticker inside the box – a serial number for the RescuePRO Deluxe software – which I will never use. Not because its bad or something but because I have no such needs. You may take it … of course unless someone else did not took it already 🙂

Below are the results of the benchmarks, I tested them in both USB 2.0 and USB 3.0 ports.

DRIVE USB pv/READ pv/WRITE diskinfo/OVERHEAD diskinfo/IOPS SanDisk Fit USB 2.0 16GB 2.0 29MB/s 5MB/s 0.712msec/sector 2521 SanDisk Fit USB 2.0 16GB 3.0 33MB/s 5MB/s 0.799msec/sector 2441 SanDisk Fit USB 3.0 16GB 2.0 35MB/s 9MB/s 0.618msec/sector 1920 SanDisk Fit USB 3.0 16GB 3.0 91MB/s 11MB/s 0.567msec/sector 1588

What is also interesting is that while USB 2.0 version has lower throughput it has more IOPS then the newer USB 3.0 incarnation of the SanDisk Fit drive. I also did other more real life test. I checked how long would it take to boot FreeBSD system installed on each of them from the loader(8) screen to the login: prompt. The difference is 5 seconds. Details are shown below.

TIME DRIVE 28s SanDisk Fit USB 3.0 16GB 33s SanDisk Fit USB 2.0 16GB

With such small ~15% difference I will use SanDisk Fit USB 2.0 16GB as it sticks out little less outside from the slot as shown below.

Cloud Storage Prices Comparison

The Tarsnap – “online backups for the truly paranoid” – costs $0.25/GB/month. The price in Tarsnap is for data transmitted after deduplication and compression but that does not change much here. For my data the compressratio property from ZFS dataset is at 3% (1.03). When I estimate deduplication savings with zdb -S pool command I get additional 1% of the savings (1.01). Lets assume that with both deduplication and compression it would take 5% (1.05) savings. That would lower the Tarsnap price to $0.2375/GB/month.

The Backblaze B2 Cloud Storage – storage costs $0.005/GB/month.

Our single 4TB disk solution costs $230 for lets say 3 years. You can expect disk failure after that period but it may serve you as well for another 3 years. Now as we know the cloud storage prices lets calculate price for 4TB data stored for 3 years in these cloud services.

Self Solution Electricity Cost

We also need to calculate how much energy our build solution would consume. Currently 1kWh of power costs about $0.20 in Europe/Poland (rounded up). This means that running computer with 1000W power usage for 1 hour would cost you $0.20 on electricity bill. Our solution idles at 8.5W and uses 13.9W when fully loaded. It will be idle for most of the time so I will assume that it will use 10W on average here. That would cost us $0.002 for 10W device running for 1 hour.

Below you will also find calculations for 1 day (24x multiplier), 1 year (another 365.25x multiplier) and 3 years (another 3x multiplier).

COST TIME $0.002 1 HOUR $0.048 1 DAY $17.53 1 YEAR $52.60 3 YEARS

Our total 3 years electricity cost is $282.60 for building and then running the system non-stop. We can also implement features like Wake On LAN to limit that power usage even more for example.

Here are these cloud storage service providers prices.

PROVIDER PRICE DATA TIME Tarsnap $0.2375 1GB 1 Month Backblaze $0.0050 1GB 1 Month

The price for 1 month of keeping 4TB of data on these providers looks as follows.

PROVIDER PRICE DATA TIME Tarsnap $973 4TB 1 Month Backblaze $20 4TB 1 Month

For just 1 month the Tarsnap is 4 TIMES more expensive the keeping the backup on your self computer with 4TB disk. The Backblaze service is at 1/10 cost which is still reasonable.

Lets compare prices for 3 years of 4TB storage.

PROVIDER PRICE DATA TIME Tarsnap $35021 4TB 3 Years Backblaze $737 4TB 3 Years

After 3 years the Backblaze solutions is about 2.5 TIMES more expensive then our personal setup, but if you really do not want to create your solution the difference for 3 years is not that big. The Tarsnap is out of bounds here being more then 120 TIMES more expensive then self hosted solution. Remember that I also did not included costs for transferring the data into or from the cloud storage. That would make cloud storage costs even bigger depending how often you would want to pull/push your data.

EOF