Unidad de disco duro de E / S por Pid


9

¿Hay alguna manera de ver la E / S de disco por pid / proceso? Monitorix me muestra lo siguiente y me corrige si me equivoco, pero parece que el disco duro está ralentizando todo el sistema: ingrese la descripción de la imagen aquí

ACTUALIZACIÓN # 1

Encima parece dar una gran visión general sobre todo.

  • ¿Puedo preguntarte qué significa la espera que marqué en rojo?
  • ¿Es esa la espera del disco de E / S?

ingrese la descripción de la imagen aquí


2
Tienes encima, iotop o pidstat
sebelk

1
@sebelk Hola, actualicé la pregunta, sería bueno si pudieras echar un vistazo. :)
user2693017

1
no era realmente posible seleccionar la mejor respuesta, así que decidí tomar la que más me ayudó y voté por las otras.
user2693017

@ user2693017: eso está completamente bien, ya que el OP es su prerrogativa, que se adapta mejor a sus necesidades.
slm

Respuestas:


3

Es difícil para mí mirar bien estas fotos, pero:

Echa un vistazo al hombre en la cima:

Me pregunto si finalmente estás pidiendo otra cosa, en la sección CPU tienes:

Every  line contains the percentage of cpu time spent in kernel mode by all
active processes (`sys'), the percentage of cpu time consumed in user mode
(`user') for all active processes (including processes running with a nice
value larger than zero), the  percentage  of  cpu  time spent  for  interrupt
handling  (`irq')  including  softirq, the percentage of unused cpu time while
no processes were waiting for disk-I/O (`idle'), and the percentage of unused
cpu time while at least one process was waiting for disk-I/O (`wait').

In case of per-cpu occupation, the last column shows the cpu number and the
wait percentage (`w') for that cpu.  The number of lines showing the per-cpu
occupation can be limited.

De todos modos, puede leer las estadísticas específicas del disco:

d    Show disk-related output.

            When "storage accounting" is active in  the  kernel,  the  
            following  fields  are shown: process-id, amount of data read 
            from disk, amount of data written to disk, amount of data that 
            was written but has been withdrawn again (WCANCL), disk 
            occupation percentage and process name.

Así como estas opciones.

re

    D   Sort  the  current  list  in the order of disk accesses issued.  
        The one-but-last column changes to ``DSK''.
        ...

RDDSK

RDDSK   When the kernel maintains standard io statistics (>= 2.6.20):

        The  read  data  transfer issued physically on disk (so reading from 
        the disk cache is not accounted for).
        ...

WRDSK

WRDSK   When the kernel maintains standard io statistics (>= 2.6.20):

        The  write  data  transfer  issued physically on disk (so writing to 
        the disk cache is not accounted for).  This counter is maintained 
        for the  application process  that writes its data to the cache 
        (assuming that this data is physically transferred to disk later 
        on). Notice that disk I/O needed for swapping is not taken into 
        account.
        ....

LVM / MDD / DSK

LVM/MDD/DSK
        Logical volume/multiple device/disk utilization. 

        Per active unit one line is produced, sorted on unit activity.
        Such  line shows the name (e.g. VolGroup00-lvtmp for a logical
        volume or sda for a hard disk), the busy percentage i.e. the
        portion of time that the unit was busy handling requests
        (`busy'),  the  number  of  read  requests  issued  (`read'), the
        number of write requests issued (`write'), the number of KiBytes
        per read (`KiB/r'),  the  number of  KiBytes  per write
        (`KiB/w'), the number of MiBytes per second throughput for reads
        (`MBr/s'),  the  number  of  MiBytes  per second  throughput  for
        writes (`MBw/s'), the average queue depth (`avq') and the average
        number of milliseconds needed by a request (`avio') for seek,
        latency and data transfer.

        If the screen-width does not allow all of these counters, only a
        relevant subset is shown.

        The  number of lines showing the units can be limited per class
        (LVM, MDD or DSK) with the 'l' key or statically (see separate
        man-page of atoprc).  By specifying the  value  0  for  a
        particular class, no lines will be shown any more for that class.

muchas gracias. Si es difícil debido al tamaño, tome el enlace directo: i.stack.imgur.com/5ifJi.png
user2693017

8

Creo que hay muchas herramientas. Uno de ellos es pidstat:

pidstat -d 5

Muestra la E / S de los procesos cada 5 segundos.

Ejemplo

$ pidstat -d 5
Linux 3.12.11-201.fc19.x86_64 (greeneggs.bubba.net)     03/04/2014  _x86_64_    (4 CPU)

06:19:05 PM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
06:19:10 PM  1000     29486      0.00    317.93      0.00  chrome

06:19:10 PM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
06:19:15 PM  1000     29486      0.00    368.00      0.00  chrome

06:19:15 PM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
06:19:20 PM  1000     29486      0.00    591.62    836.73  chrome

06:19:20 PM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
06:19:25 PM  1000      2410      0.00      0.80      0.00  mono
06:19:25 PM  1000     29486      0.00    262.40      0.00  chrome
^C

Average:      UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
Average:     1000      2410      0.00      0.20      0.00  mono
Average:     1000     29486      0.00    385.02    209.29  chrome

Desde el punto en el que ve el Ctrl+ C(también conocido como ^C) son los totales para la duración de la ejecución anterior.


bien, ¿es posible dejarlo funcionar durante 1 hora y obtener los resultados generales?
user2693017

tal vez, no lo intenté todavía. También puede definir los PID que desea inspeccionar.

3

Eche un vistazo a estas preguntas y respuestas de U&L tituladas: gran número de solicitudes de E / S de la instancia de Amazon EC2 , donde proporciono detalles sobre una herramienta llamada fatrace. También lo cubro en estas preguntas y respuestas tituladas: Determinación del archivo específico responsable de E / S alta .

fatrace

Esta es una nueva adición al kernel de Linux y una bienvenida, por lo que solo está en distribuciones más nuevas como Ubuntu 12.10. A mi sistema Fedora 14 le faltaba 8-).

Proporciona el mismo acceso que puede obtener a través de inotify sin tener que apuntar a un directorio o archivos en particular.

$ sudo fatrace
pickup(4910): O /var/spool/postfix/maildrop
pickup(4910): C /var/spool/postfix/maildrop
sshd(4927): CO /etc/group
sshd(4927): CO /etc/passwd
sshd(4927): RCO /var/log/lastlog
sshd(4927): CWO /var/log/wtmp
sshd(4927): CWO /var/log/lastlog
sshd(6808): RO /bin/dash
sshd(6808): RO /lib/x86_64-linux-gnu/ld-2.15.so
sh(6808): R /lib/x86_64-linux-gnu/ld-2.15.so
sh(6808): O /etc/ld.so.cache
sh(6808): O /lib/x86_64-linux-gnu/libc-2.15.so

Lo anterior le muestra la identificación del proceso que está accediendo al archivo y a qué archivo está accediendo, pero no le da ningún uso general de ancho de banda, por lo que cada acceso es indistinguible de cualquier otro acceso.

NOTA: fatrace puede tomar un -p PIDargumento para que pueda dirigirlo a ver un solo PID si lo desea.


Muy buena herramienta, ¡gracias, no lo sabía!
sebelk

tienes una herramienta relacionada y agradable que es excelente
sebelk

@sebelk: sí, gracias, ten eso instalado también.
slm

Me gusta esta herramienta Muestra qué tarea accede a qué archivos en el disco. Sin embargo, estos archivos también se pueden mapear, por lo que solo ocurre el acceso al búfer y no hay acceso de E / S.
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.