Instale um sistema, inicialize-o e confira as estatísticas da camada de bloco em /sys/block/${DEV}/stat
, por exemplo, /sys/block/sda/stat
.
Citando a documentação :
The stat file consists of a single line of text containing 11 decimal values separated by whitespace. The fields are summarized in the following table, and described in more detail below:
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
read sectors, write sectors
These values count the number of sectors read from or written to this block device. The "sectors" in question are the standard UNIX 512-byte sectors, not any device- or filesystem-specific block size. The counters are incremented when the I/O completes.
Você pode usar este verso para obter o número de bytes mais facilmente:
awk '{printf("read %d bytes, wrote %d bytes\n", $3*512, $7*512)}' /sys/block/vda/stat
Resultados para Scientific Linux 6.1 i386
Eu testei isso em uma máquina virtual KVM / qemu executando o Scientific Linux 6.1 i386 (que é semelhante ao RHEL). Os seguintes serviços foram ativados: acpid, auditd, crond, rede, postfix, rsyslog, sshd e udev-post. A troca está em um disco separado, então não é levado em conta.
As estatísticas de 85 botas, obtidas remotamente com o SSH alguns segundos após o login aparecer, eram:
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
O tempo de inicialização foi de cerca de 20 segundos.