我想知道为了进入一个虚拟的控制台shell提示符,总共有多less数据被读取到新鲜安装的vanilla Linux系统(如32位CentOS 5.10)? 你知道,阅读所有的configuration文件,加载二进制文件,内核映像等
我正在寻找数量级的估计。 我知道Linux启动在过程的细节方面差别很大。 我们在说10Mb吗? 100MB? 1Gb的?
安装一个系统,引导它,并从/sys/block/${DEV}/stat例如/sys/block/sda/stat查看块层统计信息。
从文档引用:
stat文件由一行文本组成,其中包含由空格分隔的十一个十进制值。 这些字段汇总在下表中,并在下面进行更详细的描述:
Name units description ---- ----- ----------- read I/Os requests number of read I/Os processed read merges requests number of read I/Os merged with in-queue I/O read sectors sectors number of sectors read read ticks milliseconds total wait time for read requests write I/Os requests number of write I/Os processed write merges requests number of write I/Os merged with in-queue I/O write sectors sectors number of sectors written write ticks milliseconds total wait time for write requests in_flight requests number of I/Os currently in flight io_ticks milliseconds total time this block device has been active time_in_queue milliseconds total wait time for all requests读扇区,写扇区
这些值计算从此块设备中读取或写入的扇区数。 有关的“扇区”是标准的UNIX 512字节扇区,而不是任何设备或文件系统特定的块大小。 计数器在I / O完成时递增。
您可以使用这一行来更容易地获取字节数:
awk '{printf("read %d bytes, wrote %d bytes\n", $3*512, $7*512)}' /sys/block/vda/stat
我在运行Scientific Linux 6.1 i386(与RHEL类似)的KVM / qemu虚拟机上进行了testing。 启用了以下服务:acpid,auditd,crond,network,postfix,rsyslog,sshd和udev-post。 交换是在一个单独的磁盘上,所以没有考虑到。
在login提示出现几秒后,用SSH远程login的85个靴子的统计数据是:
Name Median Average Stdev ------------- ------ ------- ----- read I/Os 1920 1920.2 2.6 read merges 1158 1158.4 1.8 read sectors 85322 85330.9 31.9 >> read MiBytes 41.661 41.665 0.016 read ticks 1165 1177.2 94.1 write I/Os 33 32.6 1.7 write merges 64 59.6 7.4 write sectors 762 715.2 70.9 >> write MiBytes 0.372 0.349 0.035 write ticks 51 59.0 17.4 in_flight 0 0.0 0.0 io_ticks 895 909.9 57.8 time_in_queue 1217 1235.2 98.5
开机时间大约是20秒。
你在评论中说你正在评估一个netboot /networking根环境。
你必须意识到的第一件事情就是没有“香草”这样的东西 – 你不打算立即运行CentOS 5.10而没有任何改变(如果你认为你是在欺骗你自己:NFS Root已经是至less草莓,接近开心果)。
如果你想为你的特定环境 (这是真正重要的)的答案, 你将需要build立一个NFS服务器和客户机,引导它,并测量:
这两个值对性能都是至关重要的。 您可能还需要在某个时间设置几个客户端,并模拟系统的正常使用情况,以便了解人们在每天使用系统时对NFS服务器/networking的稳定状态需求工作。
另请参阅: 我们的容量规划系列 – 我们不专门讨论NFS,但是“构build,testing,重视”的一般原则适用。