0

I'm running CrunchBang Waldorf with OpenBox on a Lenovo e420. I made the switch from Windows a few months ago, and have had no problems with performance since then. Everything runs nice & fast.

Today I was geeking around experimenting with some new options for my work setup. I installed XFCE, logged in from SLiM & played around with it a bit. Returned to OpenBox, and messed with a new terminal emulator (rxvt-Unicode). I played around with the command line options to see what visual appearance I liked.

At some point after doing this for a while, terminal windows started loading slowly. I used ARandR to switch to a dual-screen setup, and at that point the system slowed to a crawl for several minutes. This has never happened before.

I had configured my rxvt windows to open with the Fish shell, and also played around with transparency effects, so I figure any of several factors could have caused the slow performance: transparency, something new XFCE installed without my knowledge, Fish, etc. (Frankly though, none of those programs ought to cause that kind of slowdown... right?)

The long story short is, if this happens in the future, how would I go about tracking it down? Any tips? I am hoping there is some logfile that will tell me what background processes were run at what times in say the last thirty minutes.

closed as too broad by slm, Anthon, jasonwryan, Chris Down, rahmu Jul 17 '13 at 12:28

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    The start to debugging any performance issue is top. – jordanm Jul 17 '13 at 3:05
  • I'm confused re: why my question is "too broad." The subject line states my question concisely, and the last paragraph does too. (Namely: how to view recent processes following a system slowdown). The other information was provided as context, and to indicate what type of activity I had been doing in case some reader had an "a-ha!" to offer. (e.g. some well-known bug). If the beef is that the other information was extraneous, that certainly wasn't my intention. It was intended to be helpful and complete. Should I remove it? Thanks, and sorry for whatever noob-sin I have committed! – Kevin Jul 18 '13 at 16:58
0

There are multiple tools to check which processes are using how much CPU and Memory.

In most cases when your system gets slow there is either a process that uses all the CPU or your memory is full.

On all system you should find ps and top both are command line tools that show the list of all processes.

top is a small interactive program that shows the processes in a sorted order and it refreshes every two seconds. You can quit top by pressing q and you will get help for the rest of the top-commands by pressing ?.

A more advanced top is htop which you have to install. It is more interactive then top and has more color and it sopourts the same key commands that are used by top.

Sometimes your system can be so slow that even top and htop will be difficult to use. Then you can use ps. When you just execute it without any arguments it gives the processes that you have started via console, which is not very useful on a desktop.

Normally I run

ps -aux

this gives you a list of all processes running on your system. The -a means that all process from all users are shown, the -x means that all process a shown even those that were not started on a regular console. In short on a desktop use always ps ax.

The -u changes the formatting so that ps show the CPU and memory usage and much more.

To sort the output of ps you have -m, and -r. -m sort by memory consumption and -r by CPU consumption. These I normally combine with the head -$N command which gives only the first $N lines, like this

ps -raux | head -11

When you want to get the top 5 memory user every 2 seconds you can do this on Linux with the watch command

watch "ps -maux | head -6"

You can exit from watch by pressing Ctrl+c.

When you want to know how much memory you have in total and how much of it is used by all the processes you can use the free command. It displays the amount of used, free, buffers and cached memory for your RAM and for your swap partition. If the amount of used memory in swap too high it is a good indicator for what is going wrong.

For all these commands there are man pages which you can get by typing and quit by pressing q.

man $COMMAND

For example

man ps
  • Raphael, thanks for the helpful response. I knew top/htop existed, although they didn't help yesterday because the system was not responsive at all. However, your response is thorough and very helpful and I'll be referencing it in the future. – Kevin Jul 18 '13 at 16:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.