Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

508
Vistas
Using 'ps' command in Linux, how to see the realtime data?

I found that my java web server(tomcat) used high cpu, so I used 'ps aux' to see the process infomation, like:

# ps aux  | grep -E "PID|java"
USER       PID %CPU %MEM    
root      7533  143 39.8 

It showed that java took 143% cpu. Then I used 'top' command to see, the cpu usage of java process was also about 140%.

After that, I took the web server offline(no access, bug process still living). Then I used top to see, java used very low cpu:

# top | grep -E "PID|java"       
PID %CPU %MEM    TIME+  COMMAND 
7533  0.7 39.9 455:13.81 java   
PID %CPU %MEM    TIME+  COMMAND

'vmstat' also showed that the cpu was almost idle:

# vmstat 1
-----cpu------
us sy id wa st
 19  1 79  1  0
 0  0 99  1  0
 0  0 100  0  0
 0  0 100  0  0
 0  0 98  1  0
 0  0 99  1  0

Then, I used 'ps' command again, the result was:

#ps aux  | grep -E "PID|java"
USER       PID %CPU %MEM  
root      7533  137 39.8 

It showed that 7533 still takes 137% cpu! After a long time, I check 'ps' again, the result is still %137...

So, dose the 'ps' command show some old data? And how can I see the realtime data by 'ps'(Because I want to use 'ps -L' to see the information of thread)? Or is that just impossible?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

there are many tools to see the almost real time process state, like:
top
htop
dstat

Also, in linux, you can explore system state, including cpu information, process information, network and interface information and so fourth under /proc folder.
This is where all the data that tools extract from.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda