Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Oct 2000 22:51:29 -0700
From:      John DeBoskey <jwd@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Cc:        Mark Murray <markm@FreeBSD.org>, DougB@gorean.org
Subject:   Re: cvs commit: src/etc rc rc.shutdown src/etc/defaults rc.conf
Message-ID:  <20001015225129.A12949@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
There appears to be a raw vs. blocked data size issue with
/dev/random. The following patch to /etc/rc provides a serious
performance boost when booting up without a /entropy file:


Index: rc
===================================================================
RCS file: /home/ncvs/src/etc/rc,v
retrieving revision 1.235
diff -u -r1.235 rc
--- rc	2000/10/16 04:44:35	1.235
+++ rc	2000/10/16 05:33:11
@@ -201,10 +201,10 @@
 				# XXX temporary until we can get the entropy
 				# harvesting rate up
 				# Entropy below is not great, but better than nothing.
-				(ps -gauxwww; iostat; vmstat; sysctl -a; dmesg) > /dev/random 2> /dev/random
+				(ps -gauxwww; iostat; vmstat; sysctl -a; dmesg) | /bin/dd of=/dev/random bs=4k
 				( for i in /etc /var/run ; do
 					cd $i ; ls -al ; cat *
-				done ) > /dev/random 2> /dev/random
+				done ) | /bin/dd of=/dev/random bs=4k
 			fi
 		fi
 		;;


It is worth noting that the first subshell generates about 21k worth
of data sent to /dev/random. The for loop generates about 576k of
data. On a 200Mhz Pentium Pro system the above diff runs the seeding
process in 63 seconds. Increasing the blocksize has no more effect
while decreasing it increases runtime. bs=1k == 130 seconds...

Question: do we need 1/2 meg of seed data? Most of it is static...


Comments welcome!

-John




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001015225129.A12949>