My notes / cheatsheet on the top program

11 Feb 2018, by Pang Yan Han

Over the last week, I have been spending some of my free time learning how to use the top program.

These are some notes I’ve written on it: https://github.com/yanhan/notes/blob/master/top.md.

I believe this is just a 5 minute read, so do check it out!

Some thoughts / comments on top

To someone new to the tool, top can be pretty intimidating. My first impression of top is that it is a black screen that spews out a bunch of information on processes running on the system and updates itself every few seconds. While some of the information is easily understood and useful (such as CPU and memory usage), other information, such as the load average numbers, can seem downright cryptic. Contrast that to more modern monitoring tools that DevOps engineers / SREs make use of, such as DataDog, which provide beautiful dashboarding, top looks like it can go to the museum.

In my personal experience, even Linux users far more experienced than myself do not use top to identify processes which take up a lot of CPU or memory (granted, such information may be captured in their other monitoring tools). Some of them will use htop instead, which seems to provide the same information but with better visualization on the CPU and memory part - and based on my interactions with them, it does not seem like they are power users of htop either.

We can summarize the downsides of top as follows:

  • intimidating and non-intuitive user interface. Probably need to read some tutorial before being able to use it proficiently
  • some numbers may not be immediately understandable without reading a tutorial / manpages / etc
  • there are “better” competitor tools such as htop
  • social effect: given the above, it is likely that your friends / colleagues will recommend usage of another tool and perhaps even recommend you not to use top

So in light of these, why did I spend time learning it?

The main reason is: top seems to be available on most Linux systems. Sometimes, it may not be possible to install any arbitrary software on systems I have to debug. On these systems, I find that top is available.

Hopefully my notes will change some negative perceptions about top. I certainly had fun learning it and my impression of it changed totally.

Once again, here is the link: https://github.com/yanhan/notes/blob/master/top.md

Other stuff

In the month of January, I was extremely occupied at work; probably the most intense work in my professional career so far. Hence I did not have the time and energy to write a post in January. Hopefully I can keep up my goal of writing one post per month (at the minimum).

I have written a lot of documentation at work and more recently applied the same work ethic on my personal projects. Some of these personal projects are my notes on various technologies, which I eventually hope to open up after some reorganization.

Recently, inspired by Julia Evans and her comic on How to be a Wizard Programmer, I adopted the practice of writing notes on non-fiction books that I’ve read. I find that it helps me retain the knowledge better. In addition, if I happen to forget what I have read, I know that I have a relatively short reference in the notes and can get up to speed quickly without haviing to read through the entire book (always welcome). The downside is that this takes a lot of work and it means I have less time to do other stuff and especially to read other new material.

comments powered by Disqus