Tag Info

Hot answers tagged

12

F1 or h will show you the legend. It looks like in this color scheme: CPU: blue is for low priority threads green is normal priority threads black is for io-wait see below for more. Memory: green is memory in use blue is buffer orange is cache


10

I use this script (from this thread on the Arch boards): #!/bin/bash read cpu a b c previdle rest < /proc/stat prevtotal=$((a+b+c+previdle)) sleep 0.5 read cpu a b c idle rest < /proc/stat total=$((a+b+c+idle)) CPU=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))


7

Here is the laziest way (or homebrew way) First install Homebrew if you haven't Second brew install htop-osx Third, done [Updated htop to htop-osx, thanks @clwen]


6

Check out sar, as well. Implementations can vary widely from nix to nix, but it should give you basic system stats, at given snapshots. I'm not sure how accurate the values are at the point at which the command is first initialized, but you might play around to see how it compares to top, iostat, etc. The output is column-based, like top, so you should be ...


6

The fan Mine does this too, running Fedora 14. Try getting a compressed can of air and blowing out the vents on the back and side of the case. Also periodically you'll wan to remove the keyboard and blow compressed air directly on the fan's blades. They get caked with dust and start to effect its effectiveness by weighting it down. The best thing about ...


5

You're asking the wrong question: you've got an overheating system which should be solved by cooling the system. Playing games with process load is going to yield an unsatisfying hack. And since you've got hardware running at its thermal limits, you can fairly expect that problem to worsen. If you cannot remedy the hardware, see if you can slow the whole ...


4

From man htop: INTERACTIVE COMMANDS Space Tag or untag a process. Commands that can operate on multiple processes, like "kill", will then apply over the list of tagged processes, instead of the currently highlighted one. U Untag all processes (remove all tags added with the Space key). F9, k "Kill" process: sends a ...


4

A complete re-write of my previous post. Got a bit curious and checked out further. In short: the reason for the difference is that openSUSE uses a patched version of top and free that adds some extra values to `cached'. A) Standard version top, free, htop, ...: Usage is calculated by reading data from /proc/meminfo: E.g.: #free: Row Column | ...


4

If I understand that script correctly, it doesn't actually enable swap in any way. Instead it just pretends that the system has swap by replacing /proc/meminfo so that free and htop believe that the system has swap, but the kernel is in no way able to use this fake swap. If you look at the script, you may notice that no swap file or partition is mentioned ...


4

From htop source code, file UptimeMeter.c, you can see: char daysbuf[15]; if (days > 100) { sprintf(daysbuf, "%d days(!), ", days); } else if (days > 1) { sprintf(daysbuf, "%d days, ", days); } else if (days == 1) { sprintf(daysbuf, "1 day, "); } else { daysbuf[0] = '\0'; } I think ! here is just a mark that server has been up for more ...


4

Something like this? (while kill -0 $pid; do sleep 1; done) && echo "finished" Replace $pid with the process id and echo "finished" with whatever you want to do when the process exited. For example: (while kill -0 $pid; do sleep 1; done) && mail ...


3

You have greatly misunderstood what that post means by "fake swap". There are some programs that for various reasons insist on a system having swap space enabled (cough Oracle cough). If it isn't, the program—or at least its installer—complains. Of course with the aforementioned database there are ways to tell it to continue anyway, but people often don't ...


3

This is more of a long comment but you should have a look at thinkwiki.org it is the resource for Linux on ThinkPads. As for the temperature, I had similar problems with my t4500 and sorted it out by playing with The CPU governor which controls CPU frequency scaling. Your choices are: Performance keeps the CPU at the highest possible frequency Powersave ...


3

Don't you have colors? Green Blue Orange Mem[|||||||||||||||||||||||||||||||||||||||||||| 1978/7847MB] Where green should be 1978 MiB. Else you can enter F2 -> Under setup stay on "Meters" -> Right arrow to get to "Left column". -> Down 1 to get to "Memory Bar". Then press enter to view various ways of display. When it comes to ...


3

This is not possible, as of htop 0.8.3. Source: the source code. The best you can do is sort processes by user, root's processes will be conveniently lumped together.


3

This sort of inconsistency is usually indicative of high processor usage by kernel threads, which aren't displayed in htop by default. To display them, in htop go to Setup, then Display options, and then uncheck Hide kernel threads. This should allow you to see the thread(s) that are responsible. You can also disable this behaviour by setting ...


3

Have you looked at collectl? It's handy because you can tailor the output to your needs. See: http://collectl.sourceforge.net/


3

I am wondering why top and htop don't display -100 for higest priority real time processes ? That's because SCHED_RR and SCHED_FIFO have fixed static priorities from 1-99: Source For realtime priorities, the order is reversed: 99 is indeed the highest one, contrary to the ususal "lower is higher". Per your comment I misunderstood your question, ...


3

Have a look at cgroups, it should provide exactly what you need - CPU reservations (and more). I'd suggest reading controlling priority of applications using cgroups. That said, put the important yet often idle processes into group with allocated 95% of CPU and your other applications into another one with allocated 5% - you'll get (almost) all of the power ...


3

As far as I know, the only way to show the full command line is to scroll right with the arrow keys or to use a terminal with a small font.


2

htop is unaware it is running on a kernel level virtualized environment. It is then showing the CPU usage for all the OS instances sharing the same kernel, not just yours. The regular top might not present this issue. Have a look to vtop output too.


2

System load isn't really directly related to how much work the system is doing. You could have a load average of only 2.0 and be doing a lot more work than a load average of 8.0. All the load tells you is the average number of programs eligible to be run. If they are all waiting on your overloaded disk, your CPU won't be doing much of anything, but your ...


2

If you add up MEM% for all the identical looking chrome processes, then you have well over 100%, which is impossible. That's because those are not, in fact, separate processes, they're threads, which share the same memory space. htop shows these by default, but see here for how to change that and get a view that will make more sense to you. Your total used ...


2

If you run a fake job such as sleep 120 and then watch it in htop you'll notice that its state is S aka "SLEEP" and the processes TIME remains at 0:00.00 for the duration. That's because that process is consuming 0 CPU time, which is the intent of the TIME column. It tracks the amount of CPU time a given process has used. ...


2

Q#1: make the CPU/Memory at the top only count those PIDs. Is this possible? Unfortunately no top and htop do not provide a mechanism for only showing the individualized load in the upper portion of their output. However the CPU/Memory resources are displayed per process as 2 of the columns of output for each PID. enter 'tree' mode on startup, or ...


2

The problem is either with your display setup or htop itself. To eliminate that it's an issue with htop can you attempt to redirect its output to a file? $ htop > htop_dump.txt After running this then hit Ctrl+C. If there's content in the file, more htop_dump.txt, then the issue likely lies with your screen setup in your terminal/shell. If on the ...


2

htop has a setup screen, accessed via F2, that allows you to customize the top part of the display, including adding or removing a "Load average" field and setting it's style (text, bar, etc.). These seem to be auto saved in $HOME/.config/htop/htoprc, which warns: # Beware! This file is rewritten by htop when settings are changed in the interface. # The ...


2

htop shows the exclamation mark when the server has been up since 100 or more days. While once system administrators had pride in showing long uptimes, nowadays the system has to be rebooted to be kept up to date with new kernels and some security fixes. For such reason, a long uptime is probably not a good thing and I tend to interpret the exclamation mark ...


2

If you don't have the pid, this will run until all instances of ffmpeg are finished: (while pidof ffmpeg | grep -q "[0-9]*"; do sleep 1; done) && echo "finished"



Only top voted, non community-wiki answers of a minimum length are eligible