GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing ianix.com — A comparison of /dev/random speed on Linux and BSD

IANIX
About     Privacy    

The Test: Comparing /dev/random speed on Linux and BSD

Date: January 6, 2012

IBM ThinkPad (1.8GHz)
DragonFlyrandom129770365bytes/sec
urandom79501725bytes/sec
OpenBSDrandom92374770bytes/sec
FreeBSDrandom35212262bytes/sec
Debianurandom3576499bytes/sec
NetBSDurandom1379969bytes/sec
Single-core Dell OptiPlex (2.54GHz)
DragonFlyrandom160196377bytes/sec
urandom81261656bytes/sec
OpenBSDrandom150056320bytes/sec
FreeBSDrandom29790795bytes/sec
Debianurandom2388368bytes/sec
NetBSDurandom941130bytes/sec
Gateway Solo laptop (600MHz)
DragonFlyrandom39643501bytes/sec
urandom20024305bytes/sec
OpenBSDrandom28902905bytes/sec
FreeBSDrandom10608869bytes/sec
Debianurandom1002416bytes/sec
NetBSDurandom421040bytes/sec

Operating systems tested:

  • DragonFly BSD 2.10.1 i386
  • OpenBSD 5.0 i386
  • FreeBSD 8.2 i386
  • Debian GNU/Linux 6.0.3 i386
  • NetBSD 5.1 i386

Methodology: I downloaded and burned ISO installation images for DragonFly, FreeBSD, Debian, and NetBSD, and used my existing (official release) OpenBSD CDs to perform fresh, bare-metal installs on three different computers: a 1.8GHz IBM ThinkPad, a 2.54GHz Dell OptiPlex, and a 600MHz Gateway Solo. No VMs were used, and default installation parameters were accepted. (Only non-default choice: The UFS filesystem was chosen over HAMMER on DragonFly, given the small disks of the test machines.) I rebooted each machine after installation, logged in, and ran dd if=/dev/random bs=32k of=/dev/null, experimenting with different blocksize values before picking the fastest in each case. I then ran dd, using the count parameter in conjunction with the blocksize to write an equal number of bytes for each OS to /dev/null, thereby getting the purest numbers on /dev/random device speed. /dev/random speed comparison
of BSD and Linux

Discussion: DragonFly has the highest /dev/random performance with OpenBSD following close behind. The /dev/random devices on DragonFly and OpenBSD are so fast that when wiping drives on these test machines, /dev/zero would not offer a performance improvement over /dev/random, as the disk itself is the limiting factor.

Please note that:

  • On OpenBSD, all /dev/*random devices use the same code.
  • On FreeBSD, /dev/urandom is a symlink to /dev/random.
  • On Linux and NetBSD, /dev/random was too slow to record useful data and so /dev/urandom was chosen.
  • On DragonFly BSD, /dev/random is inexplicably faster than /dev/urandom. This contradicts the current (as of Jan. 6, 2012) random(4) manual page which states that "The /dev/urandom device uses a different and much faster algorithm, but one which is not considered to be as secure (though for all practical purposes it probably is good enough)."
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.