Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

507
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!