Showing posts with label bsd. Show all posts
Showing posts with label bsd. Show all posts

Monday, October 24, 2016

FreeBSD on Intel NUCs

I've been away from FreeBSD for a few years but I wanted some more functionality on my home network that I was able to configure with my Synology NAS and router. Specifically, I wanted:

  • a configurable caching name server that would serve up authoritative private names on my LAN and also validates responses with DNSSEC.
  • a more configurable DHCP server so I could make the server assign specific IPs to specific MAC addresses.
  • more compute power for transcoding videos for Plex.

Running FreeBSD 11 on an Intel NUC seemed like an ideal solution to keep my closet tidy. As of this week, $406.63 on Amazon buys a last generation i3 Intel NUC mini PC (NUC5I3RYH), with 8GB of RAM and 128GB of SSD storage. This was the first model I tried since I found reports of others using this with FreeBSD online, but I was also able to get it working on the newer generation i5 based NUC6i5SYK with 16GB of RAM and 256GB of SSD. The major issue with these NUCs is that the Intel wireless driver is not supported in FreeBSD. I am not doing anything graphical with these boxes so I don't know how well the graphics work, but they are great little network compute nodes.

Installation

I downloaded the FreeBSD 11 memory stick images, and was pleased to see that the device booted fine off the memory stick without any BIOS configuration required. However, my installation failed trying to mount root ("Mounting from ufs:/dev/ufs/FreeBSD_Install failed with error 19."). Installation from an external USB DVD drive and over the network with PXE both proved more successful at getting me into bsdinstaller to complete the installation.

I partitioned the 128GB SSD device with 8GB of swap and the rest for the root partition (UFS, Journaled and Soft Updates). After installation I edited /etc/fstab to add a tmpfs(5) mount for /tmp. The dmesg output for this host is available in a Gist on Github.

Warren Block's article on SSD on FreeBSD and the various chapters of the FreeBSD Handbook were helpful. There were a couple of tools that were also useful in probing the performance of the SSD with my FreeBSD workload:

  • The smartctl tool in the sysutils/smartmontools package allows one to read detailed diagnostic information from the SSD, including wear patterns.
  • The basic benchmark built into diskinfo -t reports that the SSD is transferring 503-510MB/second.
But how well does it perform in practice?

Rough Benchmarks

This post isn't meant to report a comprehensive suite of FreeBSD benchmarks, but I did run some basic tests to understand how suitable these low power NUCs perform in practice. To start with, I downloaded the 11-stable source from Subversion and measured the build times to understand performance of the new system. All builds were done with a minimal 2 line make.conf:

MALLOC_PRODUCTION=yes
CPUTYPE?=core2

Build Speed

Build CommandEnvironmentReal Times
make -j4 buildkernel/usr/src and /usr/obj on SSD10.06 minutes
make -j4 buildkernel/usr/src on SSD, /usr/obj on tmpfs9.65 minutes
make -j4 buildworld/usr/src and /usr/obj on SSD1.27 hours
make buildworld/usr/src and /urs/obj on SSD3.76 hours

Bonnie

In addition to the build times, I also wanted to look more directly at the performance reading from flash and reading from the NFS mounted home directories on my 4-drive NAS. I first tried Bonnie++, but then ran into a 13-year old bug in the NFS client of FreeBSD. After switching to Bonnie, I was able to gather some reasonable numbers. I had to use really large file sizes for the random write test to eliminate most of the caching that was artificially inflating the results. For those that haven't seen it, Brendan Gregg's excellent blog post highlights some of the issues of file system benchmarks like Bonnie.


Average of 3 bonnie runs with 40GB block size
ConfigurationRandom I/OBlock InputBlock Output
Seeks/SecCPU UtilizationReads/secCPU UtilizationWrites/secCPU Utilization
NFS99.20.91065054.8899667.5
SSD880913.553867125.3316091711.3

The block input rates from my bonnie benchmarks on the SSD were within 5% of the value provided by the much quick and dirtier diskinfo -t test.

Running Bonnie with less than 40GB file size yielded unreliable benchmarks due to caching at the VM layer. The following boxplot shows the random seek performance during 3 runs each at 24, 32, and 40GB file sizes. Performance starts to even off at this level but with smaller file sizes the reported random seek performance is much higher.

Open Issues

As mentioned earlier, I liked the performance I got with running FreeBSD on a 2015-era i3 NUC5I3RYH so much that I bought a newer, more powerful second device for my network. The 2016-era i5 NUC 6i5SYK is also running great. There are just a few minor issues I've encountered so far:

  • There is no FreeBSD driver for the Intel Wireless chip included with this NUC. Code for other platforms exists but has not been ported to FreeBSD.
  • The memory stick booting issue described in the installation section. It is not clear if it didn't like my USB stick for some reason, or the port I was plugging into, or if additional boot parameters would have solved the issue. Documentation and/or code needs to be updated to make this clearer.
  • Similarly, the PXE Install instructions were a bit scattered. The PXE section of the Handbook isn't specifically targetting new manual installations into bsdinstall. There are a few extra things you can run into that aren't documented well or could be streamlined.
  • Graphics / X11 are outside of the scope of my needs. The NUCs have VESA mounts so you can easily tuck them behind an LCD monitor, but it is not clear to me how well they perform in that role.

Friday, June 28, 2013

Trip Report from USENIX ATC 2013

I spent half of the week at USENIX ATC in San Jose. I previously attended in 2000, 2001, 2002, and 2004, and I have been to other more academic USENIX conferences in the intervening years such as FAST and OSDI, but I have not made it back to Annual Tech in nearly a decade.

The conference is very familiar but has also definitely changed since '04 (no more terminal rooms and the BoF board was nearly empty!) I was very happy with the caliber of the accepted papers in the main conferences as well as in many of the workshops of Federated Conferences Week (HotStorage, HotCloud, etc.). There is less industry and open-source participation now, but still a variety of really interesting talks about storage, networking, operating systems, virtualization, and more from academia and (a smaller subset of) industry.

As I've previously noted on this blog, I think the BSD conferences are great, but that it is very important for the FreeBSD community to also present work at some of the broader open-source and academic systems conferences. I would be much more likely to attend EuroBSDCon if it were held adjacent to EuroSys or FOSDEM, for example. And would be more likely to attend a U.S.-based BSD conference if it were held adjacent to a USENIX or O'Reilly Strata event.

On Wednesday my team presented one of our main projects of last year, Janus: Optimal Flash Provisioning for Cloud Storage Workloads. This work describes a method for automatically segregating hot and cold storage workloads in a large distributed filesystem, formulates an optimization problem to match the available flash to different workloads in such a way as to maximize the total reads going to flash, and then places that hot data on the distributed flash devices instead of distributed disk devices.

There were a number of other really interesting talks about flash, virtualization, and distributed storage systems, but I wanted to highlight two short-papers that I think would most appeal to the FreeBSD audience here:

  • Practical and Effective Sandboxing for Non-root Users, Taesoo Kim and Nickolai Zeldovich, MIT CSAIL
    This was a nice practical short paper about interposing system calls, using unionfs in a clever way, and taking some revision control ideas for a nice little tool.
  • packetdrill: Scriptable Network Stack Testing, from Sockets to Packets, Neal Cardwell, Yuchung Cheng, Lawrence Brakmo, Matt Mathis, Barath Raghavan, Nandita Dukkipati, Hsiao-keng Jerry Chu, Andreas Terzis, and Tom Herbert, Google
    Another practical short paper about a portable tool, which works on FreeBSD or Linux, that enables testing the correctness and performance of entire TCP/UDP/IP network stack implementations, from the system call layer to the hardware network interface, for both IPv4 and IPv6. This tool was instrumental in identifying 10 bugs in the Linux network stack and enabling the development of three new features: TCP—Early Retransmit, Fast Open, and Loss Probes.

I'm not sure if I'll go to FAST, or USENIX ATC, or both next year, but it's likely I'll attend at least one. What other industry conferences outside of the BSDCan/EuroBSDCon circuit does the FreeBSD community congregate at these days? For folks that have been in industry 10+ years, do you go to more or less industry conferences now than in the past?

Tuesday, August 10, 2010

BSDCan on Google's Open Source Blog

A coworker of mine, Kirk Russell, just posted an excellent summary of BSDCan through the years on the Google Open Source Blog.

I wasn't able to make it to BSDCan this year due to family commitments, but I did make it to another open source conference later this summer that I also wrote about on Google's open source blog.

Kirk and I haven't worked closely together but we both do our best at evangelizing BSD and open source inside our respective corners of the company. It's great to see his post about all the excellent work happening in the BSD community on a corporate blog.

Sunday, May 30, 2010

Kirk McKusick on Journaling Soft Updates in FreeBSD

Dr. Kirk McKusick has produced a high quality recording of his talk on Journaled Soft-Updates at BSDCan 2010. This is the 92nd BSD conference video in the BSD Conferences YouTube channel.

Saturday, May 29, 2010

AsiaBSDCon 2010 Videos

The videos from AsiaBSDCon 2010 are now available on the BSD Conferences YouTube channel. The full list of 17 AsiaBSDCon videos includes:



Thanks Hiroki Sato and the other organizers of AsiaBSDCon for running a successful conference and uploading these videos. Some of these videos were previously available on ustream but are not currently accessible there. The YouTube channel provides automatic machine generated captions in ~50 languages, fast streaming, and a total of over 90 videos from conferences over the past ~3 years.