Unable to run top command in Linux after a few days of uptime

1

After 3 days uptime, I can't run top in Linux.

This is x86 Linux Fedora Core 8 running under vmWare under Windows XP.

[root@fc8 ]# uname -a
Linux fc8 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:55:12 EDT 2007 i686 i686 i386 GNU/Linux

ps, uptime works fine.

Anyone have any suggestion on what might be the problem or how to diagnose it?

Updates:
There is no error message. The "top" command just hangs there.

Also, one other problem I notice at the sametime was that time somecommand gives:

real    0m0.000s
user    0m0.000s
sys     0m0.000s

The somecommand did take a few seconds to execute.

The system time in Linux under vmWare session is corrected. I don't use the ntp to sync time. I have a cron job to sync time with the hwclock --hwtosys command.

tony-p-lee

Posted 2009-12-03T17:07:10.803

Reputation: 591

1I think you might be more likely to find your answer at SuperUser.com – DOK – 2009-12-03T17:09:47.743

1When you go there, be sure to bring with you the error message you're getting, or any information at all as to what actually happens. – qid – 2009-12-03T17:11:48.483

1superuser.com if it's just your personal machine, serverfault.com if it's server (and since it has few days uptime it's probably server) – Phil – 2009-12-03T17:15:19.530

1try running "strace top" to see where top is getting stuck. It may give you some clues. – camh – 2010-01-05T08:36:47.980

Answers

1

What is the VM's clock showing at these times? It could be something strange in what-ever combination of clock syncing (if any) is going on. If VMWare is slowing the VM's clock a lot to try account for what it thinks is the VM's time getting to far ahead then that might explain time returning a wall-clock time of 0 and top (which takes some readings, waits a second or so, takes some more readings, then updates its display) pausing waiting for the second(s) to tick over.

If the clock does seem to be where is shouldn't be: I find the most reliable way to keep VM clocks accurate is to make sure VMWare's clock sync options are off and use NTP with tinker panic 0 at the top of the config file.

David Spillett

Posted 2009-12-03T17:07:10.803

Reputation: 22 424

David, I use this to sync time instead of ntp. I notice the hwclock in Linux always provide the right time. I have issue with company firewall blocking the NTP.

[root@fc8 pogo]# crontab -l

hourly to sync the hwclock

0-59 * * * * /sbin/hwclock --hctosys

Work day sync of NTP server at 11 am

  • 11 * * 1,2,3,4,5 /usr/sbin/ntpdate 10.81.24.191
  • < – tony-p-lee – 2009-12-03T20:07:11.840

The time in Linux under vmWare is correct. – tony-p-lee – 2009-12-03T20:07:49.267

0

Question: Did you use a newly woken up vmware session? I noticed that the clock sometimes only restores to the correct time after something like a minute, although it feels a lot longer :-(. Did you check your (ntp?) time-service?

Thomas

Posted 2009-12-03T17:07:10.803

Reputation: 272

0

You could try installing and using htop - http://htop.sourceforge.net/

How log did you leave top sitting there? Did you give it 10 minutes, for example?

pbr

Posted 2009-12-03T17:07:10.803

Reputation: 1 285

This time, I reboot the system. Previously, I have seen it hanged there for at lease a few hours.

Reboot Linux in vmWare does solve the problem. – tony-p-lee – 2009-12-04T06:58:36.067

Just did a yum install htop, it is very nice.

BTW, I might be able to use strace to track down deeper, will try that when I see it happen again.

Thanks for suggestion and inspiration... – tony-p-lee – 2009-12-04T07:30:13.680