Showing posts with label freebsd. Show all posts
Showing posts with label freebsd. 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.

Wednesday, January 7, 2015

AsiaBSDCon 2014 Videos Posted (6 years of BSDConferences on YouTube)

Sato-san has once created a playlist of videos from AsiaBSDCon. There were 20 videos from the conference held March 15-16, 2014 and papers can be found here. Congrats to the organizers for running another successful conference in Tokyo. A full list of videos is included below. Six years ago when I first created this channel videos longer than 10 minutes couldn't normally be uploaded to YouTube and we had to create a special partner channel for the content. It is great to see how the availability of technical video content about FreeBSD has grown in the last six years.

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?

Saturday, February 4, 2012

Updated TCP Proposals and FreeBSD

There are a number of proposals for improving TCP performance coming out of Google that have some implications for FreeBSD. These proposals have taken the form of a group of IETF proposals, RFCs, patches to the Linux kernel, and research publications. A nice summary of the different initiatives is available from Lets Make TCP Faster on the Google Code Blog.

TCP Fast Open by Radhakrishnan, Cheng, Chu, Jain, and Raghavan is based on the observation that modern web services are dominated by TCP flows so short that they terminate a few round trips after handshaking. This means that the 3-way TCP handshake is a significant source of latency for such flows, and they describe a new mechanism for secure data exchange during the initial handshake to reduce some of the round-trip network transmission and associated latency for such short TCP transfers. This work shares many goals and challenges with T/TCP, which was previously in FreeBSD but suffered from some security vulnerabilities.

David Malone posted some thoughts on my Google+ post about how FreeBSD could implement the various changes. Maybe we could have some Summer of Code students work in this area this summer?

Friday, August 19, 2011

Two New Videos: SuperPages and NanoBSD

Thanks to Kirk McKusick, I'm happy to announce two new fully edited high quality videos from BSDCan 2011 in the BSD Conferences YouTube channel. I've also created a new playlist for the BSDCan 2011 videos.

The first talk is "Superpages in FreeBSD" by McKusick, and it describes the addition of superpage support to the FreeBSD 8 kernel on the Intel PC architecture. Superpages aggregate together standard-sized hardware pages into much larger "superpages". Each superpage requires only one entry in the page table replacing the numerous entries used by the standard-sized hardware pages.



The second talk is "Updates from NanoBSD: FreeNAS drives NanoBSD development" from Warner Losh, and it describes the basics of NanoBSD and how FreeNAS moved over to NanoBSD.



We now have 108 high-quality videos in the BSD Conferences channel. These videos have been watched in aggregate over 400,000 times, and our most popular video remains McKusick's FreeBSD Kernel Internals Lecture.

As a reminder, this channel was setup specifically for the BSD technical community and does not have the standard limitations on video size for other types of YouTube uploads. If you have additional video content from a conference, presentation, or class about BSD Unix please get in touch and I'd be happy to help you publish the content here.

Thursday, August 18, 2011

Luigi Talks Netmap on Google Tech Talks Channel

Last week, Luigi Rizzo visited Google and gave a talk on high-speed networking with Netmap.



This was Luigi's second talk at Google and the third talk about FreeBSD in the Google Tech Talks YouTube channel. We also have more than 100 videos available in the BSD Conferences channel.

Sunday, October 24, 2010

FreeBSD at GSoC Mentor Summit

As in previous years, Google held a "Mentor Summit" to bring together representatives from the open source organizations that participated in the Google Summer of Code to share experiences of what worked, what didn't, and generally learn from each other about shepherding students through the program. The mentor summit is always run Unconference-style and it is a great opportunity to meet, learn, and socialize with the many other open source organizations.

In addition to several hours of face to face FreeBSD-related catch-up with Brooks Davis over pizza and beer, I particularly enjoyed catching up with old colleagues and learning about the current state of a variety of other open source projects I use such as R, Boost, NTP, and Ganeti.

This weekend Brooks and I were the only FreeBSD representatives. Given that I'm local and Google sponsors the travel of 2 representatives from each open source organization it's quite unfortunate we couldn't get another FreeBSD mentor here this year. I would strongly encourage some of the other mentors that have never participated in this forum to volunteer to represent FreeBSD next year. This program has funded approximately 117 students to work on FreeBSD over the past 5 years and the mentor summit is best way I know of to improve the experience for students and open source projects next year.

Thanks again to all the FreeBSD mentors that worked with students this summer and hope to see some of you at the post-GSoC Mentor Summit next year...

Wednesday, September 15, 2010

FreeBSD Summer of Code Students Highlighted on Google Blog

As in previous years, I've posted a summary of FreeBSD Project participation in Google Summer of Code on the Google Open Source Blog.

By my count we have now mentored at least 117 students on FreeBSD development through this program. As in previous years it was tough to identify a few student projects to highlight given how much cool work is going on here. My list is certainly not complete but at least a few other people mentioned that Efstratios Karatzas, Zheng Liu, and David Forsythe had done a lot of excellent work this summer. Hats off to them, all the students and mentors this summer, and Brooks and Robert for serving as administrators of this whole thing for us.

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.

Tuesday, April 6, 2010

FreeBSD Tech Talk @ Google

Long time FreeBSD developer Luigi Rizzo from the University of Pisa came to Google last week to visit with Sam Leffler and me, and he agreed to give a talk about some of his work on link emulation and packet scheduling.



This marks the second FreeBSD video in the Google Tech Talks channel in addition to the 70+ videos in the BSD Conferences channel. Enjoy.

Saturday, February 20, 2010

Improved Conference Captions from Amazon Mechanical Turk (2)


After my initial experiments last month, I applied to the FreeBSD Foundation for funds to pay for additional human editing of the YouTube machine generated transcripts. The screenshot on the left shows an example HIT (Human Intelligence Task) available on Amazon Mechanical Turk.

The task description on the left is based on a template I created with three variables: $VIDEO_URL, $VIDEO_TITLE, and $CAPTIONS_URL. New HITs are then created by uploading a CSV file with three columns for each of those variables, e.g.

VIDEO_URL,VIDEO_TITLE,CAPTIONS_URL
http://www.youtube.com/watch?v=mMmbjJI5su0,"BSD v. GPL, Jason Dixon, NYCBSDCon 2008",http://people.FreeBSD.org/~murray/improved-captions-bsdvsgpl.sbv
http://www.youtube.com/watch?v=Pe8LdJpBGJ4,"Isolating Cluster Jobs for Performance and Predictability, Brooks Davis (DCBSDCon 2009",http://people.FreeBSD.org/~murray/improved-captions-isolatingcluster.sbv


Using this method I created 12 HITs for the first pass of editing for which I offered between $9 and $14 per video. A slightly modified template with the same three variables was used to pay ~$7 per video for a second pass to further improve the transcripts improved in the first pass.

The template has gotten more detailed over the past month in response to all of the minor ways that workers submitted less than perfect transcripts. The actual SBV file format used by YouTube captions is not formally specified anywhere as far as I can tell, but the 60 character maximum width and simple format can be verified in submitted transcripts with a few emacs macros.

The transcript files have been checked into the FreeBSD Doc CVS Repository. The full list of videos with human-edited English language transcripts is:

Tuesday, April 21, 2009

50th BSD Video Posted: All DCBSDCon '09 Videos Live

Jason Dixon has made available the last 4 videos from DCBSDCon 2009. The last video marks the 50th video uploaded to the BSDConferences YouTube channel. This channel was created less than 5 months ago and now has 924 subscribers from authenticated YouTube users, and the videos have been viewed over 76,000 times by users from around the world (includes partial views).

The newest 4 videos are :


The average number of daily views is around 500, with significant spikes above 1,500 in the days after a popular new video is announced:
And the top 10 videos sorted by views (biased towards older videos that have been available longer) are :

Tuesday, January 13, 2009

FreeBSD Kernel Internals Lecture Posted

The first lecture from Kirk McKusick's full length FreeBSD Kernel Internals course has been posted to the BSD Conferences channel on YouTube. It's been about 10 years since I first took a shortened version of this course at FreeBSDCon 1999, and only a few years since I took the follow up kernel code reading course in Berkeley, and I highly recommend this unique resource to others.



This makes the 24th video uploaded to the BSD Conferences channel since I created it just over a month ago. Thanks to Julian Elisher, Jason Dixon, Tomasz Dudzisz, and Kirk McKusick for uploading the conference videos and for contributing to our growing page of tips about video production and publishing on the FreeBSD Wiki.

As of this writing we have 644 unique subscribers to the channel and approximately 400 daily views of these videos. To date the most popular videos have been Kris Kennaway speaking about the New features in FreeBSD 7 at MeetBSD 2007, and Jason Dixon's tongue-in-cheek BSD is Dying talk at NYCBSDCon 2006. Note to conference organizers: high level talks about the new features, or talks by speakers as entertaining as Jason Dixon are likely to be well received. The YouTube analytics to the right show the top 10 most popular videos from the channel as well as some demographic information.

Sunday, January 11, 2009

Follow FreeBSD on Twitter and send tweets from FreeBSD command line

It just came to my attention that Eric Anderson setup a FreeBSD feed on twitter. There you can find updates from the FreeBSD website, from the blogs aggregated at FreeBSD Planet, and other FreeBSD related RSS feeds published as 140 character tweets with tinyurl links to the full posts. I've been using twitter for a while now for two quite separate purposes. Primarily, I enjoy following people like Tim O'Reilly to get an endless stream of interesting tech links, ideas, and thoughts throughout the day. The updates are 140 characters or less and I only click through to those that I have time for so I find it less of a time sink than logging into my feedreader (Google Reader) and really digging into the news I'm interested in. I also find it quite useful for arranging social engagements. I use it as an SMS broadcast medium to make plans and arrange to meetup with friends for dinner, drinks, movies, or whatever after work. For the latter purpose Twitter works best in conjunction with a GPS-enabled smartphone and something like Loopt.

Following Eric's lead I setup a couple of more specific FreeBSD related twitter accounts using Twitter Feed to automatically publish the updates from RSS. The first account freebsdannounce consists of all the RSS feeds from the main www.freebsd.org website (most of which I added almost exactly one year ago). The second account freebsdblogs consists of the FreeBSD Planet combined RSS feed. If you want everything subscribe to Eric's main FreeBSD feed, but if you want only a subset of that content subscribe to one of my two more specific feeds.

Finally, I couldn't find a way to make simple updates to twitter from the base FreeBSD system command line so I created a patch for very basic HTTP POST support for fetch. Apply this patch, rebuild and reinstall libfetch(3) and fetch(1) and then you can update twitter from the command line (or send a simple POST request to other web services) with :

$ fetch -x status='Experimenting with Twitter API.' http://twitter.com/statuses/update.xml

fetch(1) will then prompt you for the HTTP authentication credentials of your twitter account.

I'm not sure how useful other people find HTTP POST support in fetch. If you would find this useful let me know and maybe I'll clean up the patch above and send it out for review.