Thursday, October 5, 2017

Summer PC upgrade: $340 = 12 cores, 24 threads, 48GB RAM, with a Minty OS

I Love the smell of new hardware in the morning!

I really wanted a parallel processing monster of a machine, and while my "6" *cough-3-cough* core 6300FX worked fine, simply not everything would scale nicely on it. In a way, it's gotten better as software is more optimized now, but my own scripting really lagged compared to running on my core i5. The FX 6 core cpu's are really 3 modules with a pair of pipelines sharing some units. Floating point for example gets shared, so performance drops in those scenarios.

AMD's Ryzen is here. Looking at Ryzen 1700, that $300 would have gotten me a nice new 8 core beast of a CPU, but I'd still have to purchase memory and motherboard. Had I gone with 24GB of memory, this upgrade would be $260. DDR4 for a modern CPU is about $160 for 16GB. A decent upgrade here would be closer to $600, and I wasn't ready to spend that much.

Time to embrace old Xeons. Of note, Xeon boards are incredibly expensive, even old ones. Buy used, but be prepared to return them - those pins are fragile. I purchased a EATX board that wouldn't post. Ebay return went smoothly, and I ended up with a decent ATX dual xeon board. 

Rounding up:

Xeon x5670 (2)..........$70
Asus Z8na-d6c..........$110
Hynix 48GB DDR3 1600...$160

I could have gone with half the RAM and saved a bunch, but I figure I can mess around with a 32GB ramdrive and still have oodles of memory left over.

I probably went a little farther back in time than intended but the performance is surprising. I picked up a "Gulftown" Xeon pair - x5670 at $35 a processor. This is 7 years old, hence the price being equivalent to a raspberry pi...

Obligatory Htop ;)

After all this time, I'm still a compiz fan.

/proc/cpuinfo shows that the CPU's idle at only 1.6GHz saving power. Cores in use jump to 2.93GHz.

It's so nice to install an OS and have it detect everything. Add-in cards like sound (no sound on xeon boards usually), USB3.0 (predates the board), USB devices like the WiFi AC adapter - nothing to worry about. Linux Mint is awesome ;)

Why go with old Xeons? Why not new ones?

Well, my reasoning is cost, and a lack of substantial improvement in IPC with newer versions. Here's a general comparison on how this old architecture fared over time using geekbench.

Disclaimer - looking at 1 benchmark of different architectures, is not a very accurate way to gauge performance. A different architecture may offer specific advantages or disadvantages for that benchmark. Newer models of xeons are an evolution of the previous model where much of the architecture stays the same so I'm still considering this a fair comparison across the xeons.

Looking at 4 cores and ~3.0GHz as the 6 core models aren't as common throughout frequency ranges.

Scores obtained from geekbench - using a median score from the median page, strictly for 4 cores (multiple results from the same person considered as one result):

Looking at prices is tricky. The gulftown can be used in dual processor config at $17 a processor. Intel's 1xxx lines however cannot (and are cheap as a result). Lets consider the closest in spec 2xxx series, here the performance numbers can skew because the CPUs start using higher turbo rates - but this shows how price jumps for newer multi-CPU models.

2x4 cores:

2010 Gulftown....X5667 3.06GHz.........2737/15270 - $34
2010 Gulftown....X5677 3.47GHz.........2897/16724 - $70
2012 Ivy Bridge..E5 2637-v2 3.5GHz.....3125/18078 - $460
2013 Haswell.....E5 2623-v3 3.0GHz+....3373/17361 - $960
2015 Broadwell...E5 2623-v4 2.6GHz.....3427/17053 - $960
2015 Broadwell...E5 2637-v4 3.5GHz.....3510/22771 - $2400
2016 Skylake.....Unable to find close comparison
2x6 cores (my pick):
2010 Gulftown....X5760 2.97GHz.........2599/23882 - $70
1x8 cores (new AMD alternative over my budget):
2017 Ryzen.......1700 3.0-3.7GHz.......4244/22447 - $300

To be fair to Intel, the new architecture isn't ALL about IPC. Frequency and the number of cores has increased, while dropping power usage - a pretty tough feat. However the cost can be high. e.g. A recent high core count xeons pair:

2016 Broadwell...E5 2699-v4 2.2-3.6GHz.3000/66305 - $8000

I'm looking for a general comparison on how this architecture has aged. How does single core and multicore performance change with each generation? Is it worth it buying old xeons? 

By the numbers, this old architecture holds up surprisingly well. I'm sure you can probably get some hardware features for encryption or video encoding on the more modern architectures; some more SIMD etc. Keep in mind that xeon architecture evolved from previous generations, so it's rare for there to be a huge difference.

Going for the 6 cores, I'm sacrificing some single core speed, for a lot more multi-processes performance. I think my CPU governor choice may be contributing to a lower than expected single core performance compared to others on geekbench. I'll have to experiment with that.

The Ryzen is an interesting addition in these comparisons. It's a single CPU and was released as I was building my machine. That single CPU score is pretty solid. I'm quite surprised the old xeons can keep up in multicore score (12 cores vs 8 though...). Granted, the benchmark may simply be favorable to AMD's Ryzen architecture (completely different from Intel's), but it's a strong result regardless. ran benchmarks of a more practical nature:

NB: Gulftown used above is the last iteration of Nehalem in below's charts.
NB: Following charts are from Click the link above for their full article.

The CPUs used in testing are:
Nehalem:      Intel Core i7 875K 2.93-3.6GHz, 4 cores
Sandy Bridge: Intel Core i7 2600K 3.4-3.8GHz, 4 cores
Ivy Bridge:   Intel Core i7 3770K 3.5-3.9GHz, 4 cores

Haswell:      Intel Core i7 4790K 4.0-4.4GHz, 4 cores
Broadwell:    Intel Core i7 5775C 3.3-3.7GHz, 4 cores

NB: Gulftown was the last of the Nehalem line.

It should be noted that the biggest jump on their testing also matches the big jump in processor frequency. 

Basically, we ARE getting improvements in each new processor family, but they aren't huge in general. Over time it does add up - in single core performance, the newest chips are maybe 20-40% faster. Multicore increases don't seem to be as dramatic, but they are indeed there. The question is is it worth it to you?

If you should consider going old xeon route for whatever reason - namely you found a cheap motherboard and have access to cheap EC memory, then consider this wiki page listing all xeons.

That said, Ryzen is a pretty solid pick if you have the money for a full setup. I think for an upgrade, the old xeons were pretty solid ;)

Saturday, September 30, 2017

Using an old camera to make a microscope

My kid just turned 7. My wife and I generally look for toys that cultivate more creative interests, especially in science and math. We were looking at "toy" microscopes. A decent toy is perhaps $30-$40. Will magnify but lenses aren't great. At this price point, lenses are fixed.
Going up to $50-$60, you get a much better build - and lenses are replaceable, but not standard lab microscope lenses (RMS mount). Going up to $70 gets you an actual microscope, with metal body and RMS thread lenses. So, maybe the best both worlds is a real microscope, painted pink.  ¯\_(ツ)_/¯

While looking at these I got to thinking. I've just purchased the Sony A7. My wife took my last purchase - the Olympus E-M10, so the EP3 is my backup. My Olympus E-PL1 is just going to gather dust.

I decided to try taking this spare camera (its going for < $100 used at this time. KEH had it for $67) and mount it on a bellows using an adapter for a microscope lens - the same standard RMS lenses that would work on a regular microscope. This is all well and good, but I need a way to hold this up to a slide quite steady, and a way to light it from the back. So I mounted the bellows on video rails, with a couple blocks to hold microscope slides and another for a flashlight. I also experimented with lighting. Using a simple folded paper shroud and flash, images look very different compared to regular back-lighting.

The end result is better than I thought it would be. I did learn quite a bit about microscope lenses along the way.

Rather than a lens, a bellows is mounted on the camera. The bellows in this case is M42 (old pentax mount) so a M42 to RMS adapter is used to mount the microscope lens on the bellows. An M42 to Micro Four Thirds adapter lets this old bellows mount to the modern camera.
The bellows,, and a couple blocks are all on photo rails. A couple threaded rods holds the slides in place, and the other block holds a flashlight with built in lens. To diffuse the light and change the look of the image, a simple paper hood can be added to scatter the light from the flashlight and the flash. While not a standard microscopy lighting method, it is normal in photography.

Look closely on the leaf and you'll see stomata!

What's important here is the camera, extension tube/bellows, microscope lens, a way to hold the subject steady, and lighting.

Many people have a relatively modern camera capable of live view. This camera used is among the first cheap mirrorless cameras, the E-PL1. At the time of writing, this was seen for $67 on The bellows set me back $30 at the time, but has risen over time. granted, there's many other means of getting the microscope lens mounted. M42 focusing tubes can also be used to vary the distance of the objective from the camera. Flashlights were 2 for $10. the flash is a generic amazon basic flash for $30. Lenses can be purchased used. A plan lens gives a flatter field and is better for these large sensors, though you can find "lot" sales with several lenses on ebay for quite cheap.

Bellows alternative:

Lens lots on ebay:

The point of the bellows or focusing tubes is to vary the magnification of the subject. The farther away the lens is from the camera, the closer the front of the lens can be to it, and larger the image is on the sensor. A fixed adapter from M42 to your camera's mount will work fine.

Focusing is achieved by racking the bellows forwards or away from the slide. Altering magnification by expanding/contracting the bellows also alters focus a little and can be used to fine-tune the focus.

I didn't make my own sildes for this, though the ant used was just stuck on some scotch tape. The box of slides was a generic set purchased online.

Sunday, July 2, 2017

Chromebook II - a linux laptop

My previous foray into chromebooks

So it was about time again to get a new laptop. While I did have a recent windows laptop, my wife needed it more than I did, so $500 later, I was the owner of the fairly recent Asus c302 Chromebook.

This Chromebook is one of the nicest laptops I've ever owned. The all aluminum smooth lines make "it looks like a mac" comments common. The keyboard is wonderful to work on. The screen is above average brightness, full HD and touch capable, decent CPU etc.


The CPU is fairly powerful while sipping current (4.5W "TDP"). Not much different from the MacBook 12". 4GB of RAM is an upgrade compared to my previous 2GB RAM Chromebook. I really wish I could get 8 or 16GB but the laptop is proving itself capable even at 4, so no real complaints there. The onboard SSD works at a decent clip, and 64GB is plenty for a Chromebook's standard kit plus some Android apps, and Linux installs. While it does have 2 USB-C ports, I do wish they included the old USB-A 3.0 receptacle. The larger ports would have allowed tiny drives and micro-SD card adapters to fit nearly flush with the case. At the current time, there's nothing for USB-C that fits the bill as "low profile". It does have a regular micro-SD card slot though and I wasted no time dropping in a 128GB card for more storage.

Here's what $500 got me:
CPU     : Core M3 6Y30 (0.9-2.2GHz dual core, hyperthreading)
RAM     : 4GB
Storage : 64GB (emmc)
Screen  : 12.5" 1920x1080, touch capable, folds for "tablet mode"
Battery : 6-8 hours moderate usage, 8ish hours of video playback,
          several days of standby

Ports   : 2 USB-C, a micro SD slot, audio/mic
Weight  : 2.6 pounds

My previous Acer cb3 11" is going for $80 on ebay. It's incredible for the price, but sluggish with more than moderate use.
The CPU of the Acer 11" cb3 is a Celeron N2840 (baytrail). That CPU runs from 2.16-2.58GHz - and it's trounced by the lower clocked 0.9-2.2GHz core M3 (skylake). A prime example of how a better IPC ratio works.

Pros and Cons of Chromebooks:

The Good:
  • Chromebooks are cheap.
  • Usually light and slim formfactor.
  • Excellent battery life.
  • Keyboard dumps lesser used keys, so even small keyboards have larger than average keys.
  • The boot time is fantastically short - <10 seconds.
  • Relatively decent specs for the price.
  • Security - the OS is designed to protect the user from malicious code.
  • Recovery - the OS is designed to reset to a new state.
  • Backup - The OS is designed to load all user settings and apps from the cloud if wiped or new.
  • The OS auto updates.
  • NEW Chromebooks can run Android Apps.
  • Can run Linux chroots.
  • Linux chroot runs in parallel, no reboot needed.
  • Chroot can be backed up, restored, updated in simple one line commands.
  • Can manage chroots while still getting full use from ChromeOS.

The Bad:
  • Need to get used to a slightly different kind of keyboard
  • ChromeOS itself has a limited selection of offline applications
  • Heavy reliance on Google accounts (all your info in one place isn't good)
  • Setting up Chroots is mildly technical. The warning screen should be completely blockable but isn't unless you modify the bios.
The Ugly:
  • ChromeOS update potentially can break a chroot install, requiring a chroot update to fix.
  • Warning screen is annoying long, and pressing <SPACE> will powerwash the laptop. 
  • Warning screen cannot be eliminated, but reduced to 2 seconds and beep disabled. Required opening the laptop.

Given the bad and the ugly, this is still something I really want.
once the laptop is opened and warning screen mostly neutered, it's mostly fine. One line backup/restore also mitigates that problem. Stopping the update system when entering linux also prevents updates from breaking a chroot unless you specifically let your laptop update.

My intention:

This Chromebook is among the first to be released with the intended purpose of running android applications. Initially the Google Play Store wasn't available. This was remedied by switching to the beta channel.

My intended purpose of this was to replace my old "supercheap" Acer Chromebook 11 cb3-111. It should be noted that the cb3-111 is trending on ebay at ~$80. This is dirt cheap and actually quite a decent laptop for casual work. This meant I'm really using ChromeOS as a stepping stone to the new Android application the Play Store can provide and the majority of usage is in a Linux chroot.

Setting up a Linux chroot is quite simple. going a step further and removing the write protect screw further helps by reducing a blaring warning screen that dangerously gives the option to overwrite your work by pressing space. That's really it. 
  • put device in developer mode
  • download crouton and run to install Linux chroot
  • open laptop and remove write protect screw
  • run command to shorten warning screen to minimum and stop beep
  • put screw back and close laptop
That's the plan. 

Get Android and Linux on there:

The first thing I did when I got this was just test out the basic functionality. browse the web a little, pull up the system information, run a benchmark or two. Then I put the device on the beta channel and the playstore installed. I didn't see any problems running the beta channel, so I left it. I actually don't seem to be using Android apps much really anyway, so maybe I'll switch to stable later on.

Next I wanted this to run Linux. Here's the steps:
  • Enable developer mode (ESC + F3 + Power), ctrl+D on start up. I didn't enable debugger features.
  • Download crouton
  • Open crosh (ctrl+alt+t), type "shell" for bash
  • cd ~/Downloads
  • sudo sh crouton -r xenial -t xfce,xorg,xiwi,extension

Cleaner Linux Setup:

That's it. I now have Linux installed. Doing this means booting the laptop is met with a looooong beep on startup and 60 second warning screen saying "OS verification is disabled, press space to re-enable" which will powerwash the Chromebook and undo all of this. To get around it I opened the laptop and removed the write protect screw.

Do yourself a favor and use a GOOD screwdriver to handle the screws. Cheap metal tips can strip the screw head - and then you're screwed. You need a fine T5 torx tip to get at them too. 

The write protect screw is under a padded flap (circled in the image above). Unscrew and remove for now. 

Just as two years before, the following commands are run to reduce the delay and disable the beep:
sudo /usr/share/vboot/bin/ 0x1
sudo /usr/share/vboot/bin/ 0x8

I should note that after this the delay was still there. I had to enter these in crosh again to get it working. Not sure what happened there.

in order to develop stuff for servers, if you want to host anything:
in crouton, install IP tables:
sudo apt-get install iptables

vi /etc/rc.local
/sbin/iptables -P INPUT ACCEPT

Linux gaming lives! just install libraries for i386 as a lot of game binaries are still 32bit, not 64.
libraries for games:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libjson0:i386
sudo apt-get install libopenal1:i386
sudo apt-get install libgl1-mesa-glx:i386
sudo apt-get install openssl:i386
sudo apt-get install lib32z1
sudo apt-get install libgtk2.0-0:i386 libidn11:i386 libglu1-mesa:i386 libxmu6:i386
sudo apt-get install libpangox-1.0-0:i386 libpangoxft-1.0-0:i386
sudo apt autoremove

Lets make crouton a little easier to manage...

Create the following files in /usr/local/bin:
sudo edit-chroot -b -c /mnt/stateful_partition/chroots xenial
sudo sh ~/Downloads/crouton -f -$1
sudo sh ~/Downloads/crouton -u -n xenial
sudo /sbin/initctl stop update-engine
sudo startxfce4 -X xiwi
sudo /sbin/initctl stop update-engine
sudo startxfce4 -X xorg

This simplifies your management of the setup chroot. Just type "linux-update" to update the chroot. Or "linux-restore [archive]" to restore from an archive.

I've added stopping the ChromeOS updater as well to whenever the chroot is started. The reason for this is sometimes an update can stop the chroot from starting. This prevents that from happening unexpectedly. Automatic updates are awesome, but I much prefer control over it when it can break something. If I'm traveling for example, and happen to get wifi access momentarily, I wouldn't want an update pushed preventing me from using Linux for the rest of the trip.

Last thing - within the chroot, make a script:
sudo mount -o remount,exec /var/host/media/removable/SD\ card

Normally removable media is mounted with noexec, so you can't execute binaries and scripts. Running this will remount it so you can. In this case, the label of my microSD was "SD card" so adjust that line to suit your needs.

Monday, March 20, 2017

Nerf - or knocking over water bottles with foam...

So I got into nerf blasters recently. For me that means not only getting a blaster and darts but looking at ways to increase potential. How can I make it fire darts faster and more accurately.

It's a nice way to unwind, and leave any workstress behind. I'm sure some view an actual firing range as perfect for this - but for me, knocking over empty Poland Springs water bottles in the comfort of my living room is perfect 😁. That's really all I'm doing - knocking over a row of water bottles.

There's various types of mechanisms for launching darts. Spring based blasters force a piston down a tube compressing air quickly forcing a dart from a barrel. Flywheel based blasters use two spinning flywheels to project a dart. Air blasters build up air in a chamber, usually by pumping - and then eject the air all at once.

I started with buying a few spring based blasters. There's no spinup time like electric blasters, and while compressed air blasters are the most powerful, I haven't seen that many. They're there, but really require modding to bring out their full potential.

One of the first blasters I went for was the above hammershot. Painted it, changed the spring, added a spacer for tension, sealed the plunger tube spaces better. A little tape for a tighter o-ring fit, and alternate 7 shot brass barrel from ebay. For comfort, I added the tennis racket handle wrap. Nice one handed blaster - but not quite powerful to really aim accurately.

Here's how The spacer was created - A roll of paper and 3d pen. A 3d pen is like the end tip of a 3d printer - but controlled by your hand.

The spacer keep the spring under more tension, meaning more force and faster compression in the plunger tube. The roll of paper keeps the spacer hollow for the orange guide rod to pass.

While I was very pleased with the handling and look of the hammershot,I wasn't content with the performance. I also think that with a stronger spring than I was already using I'd break it. I picked up a cycloneshock next. The cycloneshock is another revolver but uses larger darts. By using a barrel mod, It fires the regular sized darts much much harder than other blasters. an extra spring at the back from another blaster and you're getting.

From searching forums, one of the weakpoints of the cycloneshock is the plunger rod where the springs push against. 3D pen to the rescue. Some grinding later and it fits perfectly while keeping the rod from bending.

After modding these of course I had to try building my own.

Turns out pneumatics are really interesting. Compressed air can do so much. Here's the gist. Using a pump - like a bike pump, to send air through one type of valve - a Quick Exhaust Valve, the air gets stored in a "tank". When ready to fire, lowering the pressure on the side of the QEV where it's getting pumped causes all the air to rush out from the tank. It's more efficient than using a regular switch, since as the switch is opening, the rate of exhaust starts slow. With the QEV, the air flow hits maximum almost immediately.

The basics of the QEV can be seen below.

Since the pump and release valve are at the same port on the QEV, a tee fitting works fine there. At the start, the release valve is closed. As you pump, the QEV directs air to the tank. The system pressure builds. the air between the pump, through the tee, through the QEV and in the tank is all the same pressure. When firing, the release valve opens and air rushes from the tee. As air starts flowing from the tank to the tee, it trips the QEV exhaust valve, and instead rushes out to the barrel.

Putting this into practice isn't quite as hard as you may think. I definitely overbuilt my first blaster, with too large a tank, too high a pressure potential, and too much space between the release valve and QEV. The release valve does "waste" a little air to create the low pressure for the QEV - but it's miniscule in proportion to the air in the tank - it's the air between the pump and QEV that will rush out. In  my build I redirect it to the back of the barrel - bit pointless since it's not going to add any extra performance really.

How hard can this overbuilt steampunkish blaster hit?

Really. Freaking. Hard.

Next up - make a spring based blaster and another air powered one that's more comfortable and practical. Perhaps design a barrel that can take a standard nerf magazine for reloading...

Monday, September 26, 2016

Odroid XU4 - My new NAS

Few thoughts on ARM:

ARM has been kicking ass and taking names for several years now. It's no surprise that other companies would want to acquire it - Japanese company SoftBank finished it's acquisition of ARM a couple days ago, at an astonishing $32 Billion.

ARM doesn't make anything physically - but they do create CPU designs and license them. ARM based processors are found everywhere today - in cameras, routers, smart TV, cellphones, game consoles, laptops, even servers.

For ARM based servers, the goal is energy efficiency where raw performance is secondary. Rarely would one look at arm over the standard x86 and consider it for a performance advantage. Even newer Atom processors (though the line is effectively dead *supposedly?*) is generally more powerful.

There are many use cases where processing power isn't quite necessary though. When I/O is the bottleneck, or where we need reliability, or need to keep a server running with little power, the importance of fast processors is far less. In multiprocessing environments, where a few heavy CPU bound processes can stymie a fast processor with low core count, a slower processor with high core count can still stay operational, letting a user do whatever else they may need to do.

On the Odroid-xu4:

A good use case would be a webserver, file storage or network cache system (memcached, cachewho [my own thing...]), home automation server. For my own purchase of an Odroid-xu4, I am using it as a NAS, with minor web/development jobs.

Here's the specs on the little bugger:

CPU     : Samsung Exynos 5422 (2GHz Cortex A15 x4 + 1.3GHz Cortex A7 x4)
RAM     : 2GB LPDDR3, 933MHz (16bit interface, 14.9 GBps bandwidth)
GPU     : Mali-T628
Video   : HDMI (standard type-A), 1080p capable
Audio   : HDMI, i2s (no audio jack)
USB3.0  : 2 ports
USB2.0  : 1 port
Storage : EMMC, Micro-SD
Network : RJ-45, Gigabit Ethernet
GPIO    : 30pin + 12pin section (i2s, i2c, spi, ADC etc.)

Possible uses:
HTPC - video out via HDMI means this is a compact way to create an HTPC system. various operating systems are supported - several Linux distributions, and even Android.
NAS - Standard Linux isn't too hard to turn into a NAS, but there's also dedicated storage distros like Open Media Vault.
Web Server - Python, Ruby, Apache, Nginx, PHP, Node - loads of ways to get a web app running here.
Media Streaming - Plex can turn this into a media streaming server.
Home Automation - Much in the same manner as a Raspberry PI can be used. This is probably a little less optimal, since the extra power over a Raspberry PI isn't really needed.
Robotics - GPIO pins can communicate with servo boards and arduinos and other devices giving control over mechanical parts, input for sensors, and the device of course packs a lot of processing capability.

The advantages of this over an x86 device:

Cost - $80 + SD card ($10?). x86 devices are quite cheap if you go with Atom, though not quite at this level. If you do find one, it's usually not a complete system, or lacks USB 3.0/gigabit ethernet.
Noise - very quiet fan, optional no noise case. Not really much of an advantage over Atom which doesn't need a fan in many cases either.
Size - while there ARE Intel Stick PC devices, they are lacking some connectivity - often USB3.0 and/or Gigabit Ethernet. The combination of these is necessary for a decent NAS, or any server where you want fast transfers. Looking at devices that offer USB3.0/Gigabit Ethernet means lots more money.

NB: recent SolidRun board can give this a run for its money, though it's more expensive, with some options at several times the price.

Why Odroid-xu4? Why not a Raspberry PI which has more community support?

I'm making a huge deal about Gigabit Ethernet and USB3.0 over the usual USB2.0 and 10/100Mbps Ethernet, because it's quite relevant to current media types.

A Raspberry Pi 3 is a powerful device for it's size and cost being the same credit-card size as the XU4 with a retail value of $40. It has a solid quad core CPU, but USB2.0 and 100Mbps Ethernet. It's certainly usable for a storage server, but reading from a disk would be limited to the slowest speed in the chain - 12.5MBps. That's mind numbingly slow when you're syncing a terabyte or six. 

For perspective, lets consider how different bandwidths handle 1 TB of data:

│    Interface    │       Bandwidth      Time/TB  
│"Fast" Ethernet  │  12.5MB per second 0.97 days
USB2.0           │  60MB   per second  4hr 51.3m │
Gigabit Ethernet │ 125MB   per second  2hr 20m   │
USB3.0           │ 625MB   per second  28m       │

While you won't always need to sync terabytes of information, you will be concerned with hundreds of gigabytes. Easily happens when you're getting back from holiday and took a lot of RAW images and uncompressed video. Of course you cannot expect these speeds - the harddrive itself has a limit. Of course when you're syncing from one external drive to another external drive (as is my plan) you're looking at half the bandwidth in the best case - the same bus handles reading from one drive and writing to the other. So that seemingly acceptable 12.5MBps drops to just over 6MBps - and we're assuming maximum theoretical speeds. With the USB3.0 speeds, I can comfortably sync one drive to another and not take much of a hit - I'd most likely bottleneck near the maximum write speed of my drive.

To NTFS or not to NTFS....

Assuming I use the Odroid-xu4 for a LAN, what filesystem to use? NTFS is relatively limited compared to EXT4. The primary concern was the extra CPU utilization that NTFS would take over EXT4, however NTFS will be compatible with my other computers/laptop. My initial sync was over USB anyway directly connected to the windows machine that currently holds my library - so NTFS, purely for compatibility sake.


I got the OpenMediaVault image from here.

Win32diskimager can put the ISO on an SD card.

From there that's it. Put the card in the mini server and boot up. No need for a directly connected mouse and keyboard, just ssh into it, or use the web interface. For most things NAS related, the web interface will suffice.

So you can make users, shared on connected drives, mount/unmount the drives, make users, cronjobs etc. 

I also came across this blog here

which was invaluable in configuring the NTFS drives for better performance:

Use on demand CPU governor -

in: /etc/default/openmediavault
 omv-mkconf cpufrequtils
 update-rc.d cpufrequtils defaults

CPU governor tuning:

 apt-get install sysfsutils

in: /etc/sysfs.conf

 # cpu0 sets cpu[0-3], cpu4 sets cpu[4-7]
 devices/system/cpu/cpu0/cpufreq/ondemand/io_is_busy = 1
 devices/system/cpu/cpu4/cpufreq/ondemand/io_is_busy = 1 
 devices/system/cpu/cpu0/cpufreq/ondemand/sampling_down_factor = 10
 devices/system/cpu/cpu4/cpufreq/ondemand/sampling_down_factor = 10
 devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold = 80
 devices/system/cpu/cpu4/cpufreq/ondemand/up_threshold = 80


 cpufreq-set -g ondemand -c 0
 cpufreq-set -g ondemand -c 4
 service sysfsutils start

NTFS mount options:

in: /etc/default/openmediavault

I strongly suggest you read the original link at Obihörnchen's blog to understand what each command does.

Drive performance:

root@odroid:~/major# dd if=/dev/zero of=./testfile bs=1000M count=1 oflag=direct

1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 12.7106 s, 82.5 MB/s
root@odroid:~/major# dd if=/dev/zero of=./testfile bs=1000M count=1 oflag=direct
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 12.6035 s, 83.2 MB/s

Getting over 80MBps write - that's much better than I was expecting.

root@odroid:~/major# dd if=./testfile of=/dev/null bs=1000M count=1
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 11.272 s, 93.0 MB/s
root@odroid:~/major# dd if=./testfile of=/dev/null bs=1000M count=1
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 11.313 s, 92.7 MB/s

Getting over 90MBps read - again a really decent result for a single disk.

My understanding is the drive I'm using (Western Digital RED 6TB should handle double that - 175MB/s read/write - and it's possible I might achieve that with EXT4 on this same platform. More testing is needed when I purchase another drive. For now, I'll enjoy the speeds that are near the maximum of the interface, and easily faster than my AC Wifi provides.

The drive I'm currently using will be accompanied by a few more later. This is achieved by using an external 4-bay harddrive enclosure.
Next to the Odroid, this stack of drive bays looks huge. It isn't :D
This is a Vantec HX4R.

Bays lock in place with a clip. The enclosure supports SATA and USB3.0, and from the sticker you can also see RAID settings - 0, 1, 0+1, 5 JBOD - and in the way I use it, just as a hub for all drives. That top drive is a drive I removed all drive parts and interfaces from. It's just a shell - holding some screws for the other bays but makes for a good hidden storage unit.


These benchmarks were taken using the on demand CPU governor configuration described. I've compared it against my laptop, and desktop.

Desktop: Core i5 2400 (Sandy Bridge), 16GB RAM

Laptop: Celeron N2940 (BayTrail-m), 8GB RAM
Odroid-XU4: Exynos 5422, 2GB RAM

It's interesting noting the specifications of these:


█    CPU        █  Power?             █ Cores  Frequency intro 
 Core i5 2400  █  95W TDP            █ 4      3.1-3.4   █ 2011  
Celeron N2940 █ 7.5W/4.5W TDP/SDP   █ 4      1.83-2.252014  
Exynos 5422   █ 10W/14W max CPU/GPU █ 8      2.0/1.3   █ 2015  

While it may seem that the Exynos 5422 is a higher watt CPU, this was achieved from tests from the odroid forum. Typically the entire system hovers at a wattage my laptop's processor will only dream of. There's further tweaks that lower power too - such as down clocking the GPU to reduce power as a server even more. It should also be noted, the Thermal Design Power (TDP) and Scenario Design Power (SDP). The Intel-AMD war brought in marketing departments that spread BS over these numbers. TDP was the rating the silicone was designed to handle. SDP was a typical workload. Nothing really was equal in comparing AMD and Intel CPUs that stated these. 

The power supply for the odroid system is 5 Volts, 4 Amps. That's 20 Watts. Consider that in several cases here, the GPU is also adding to power consumption:

Either way you compare the Baytrail Celeron against the Exynos 5422, the Core i5 is sorely out of place. The question is is the performance also that far out there, or do the lower powered processors give it a disadvantage in efficiency?

I ran each test a several times to get 3 close results, and kept the middle.

|               | Odroid-Xu4 | Baytrail Laptop | i5 Desktop |
| Mencoder      |    3148    |     2478        |    795     |
| p7zip (text)  |    7.342   |     6.708       |    2.675   |
| p7zip (video) |    174     |     143         |    32      |
ImageMagick   |            |                 |            |
Apache bench  |            |                 |            |

It's apparent that the i5 desktop is several times faster - but maybe it's not fast enough. This CPU power can jump over 70Watts when under heavy load. That puts it at least 10 times the power of the other CPUs. It's really interesting the see the large difference in 7zip on data that can't be compressed well (video) compared to data that compresses a lot (text). My laptop's CPU is never that far ahead of the Xu4 either. Expect laptops with ARM to gain in popularity (there's already Chromebooks and Android). Especially with the Atom line no longer available for that purpose.