imrehg 1 day ago

I've relatively recently migrated over to using btop[0], and it's the kind of modern interface, useful and informative, that I needed.

As others mention it - it seems to shows the Watts used as well :) (and network, and GPU, and disks,....)

[0]: https://github.com/aristocratos/btop

  • MomsAVoxell 1 day ago

    Yup, btop zealot here, it even replaced iStatMenu on my brand new MacBook ..

    • NetOpWibby 1 day ago

      Oh wow, now I gotta check it out.

  • hinkley 20 hours ago

    I still occasionally use alpine as a base image for containers and it looks like both doesn’t do musl so that’s out.

  • bilegeek 20 hours ago

    I like btop, but there are downsides:

    1.) No zram/zswap statistics. (Though htop only supports zram also.)

    2.) No ZFS statistics breakdown.

    3.) Doesn't support Arc GPU yet.

    4.) I can't disable the disk fill bars, which makes the I/O rate graphs extremely squished unless the console window is very large.

    • reaperducer 15 hours ago

      5.) Requires an 80x24 window. Not ideal for monitoring several machines at once.

      htop scales all the way down to 40x8 on my TRS-80.

      • JdeBP 14 hours ago

        It's bad the other way, too. btop on a 50×232 terminal over an actual 57600 BPS serial line is unusable, even in 16-colour mode. It does not have even the most basic of full-screen TUI redraw optimizations, and outputs the entire screen again and again.

  • internet101010 18 hours ago

    Long time user of btop. Only thing it is missing is a ports column next to the others. Also I think the cpu/gpu graph graph is way oversized and would like more space occupied by the open file table in general.

cogman10 1 day ago

2 Settings I change on every htop which makes a HUGE difference.

1. I disable user threads. Those mostly just clutter up the htop view while providing no useful information.

2. I enable the process tree view. Very frequently, where a process comes from is much more important than other information. It also lets you see and track things like a compiler process which is eating through a bunch of files.

IMO, both these things should be the default behavior of htop.

  • zekrioca 1 day ago

    I like the process tree view, but it stops the dynamic updates and reordering of process list.

AnotherGoodName 1 day ago

I appreciate the note on virtual memory not being reliable. This is what Windows task manager reports by default and it's terrible. Resident size is the most reliable metric. Anything else can be wrongfully inflated by things like harmless memory mapped files that won't actually hurt anything. eg. memory map 2GB of logfiles, it'll only be paged in if reading that portion of the logfile so isn't really using memory but users look at the processes and claim "OMG why does this app use so much memory". It doesn't. It uses very little. You're reading the memory usage wrong. Chrome actually had this problem for a while and they moved away from using memory mapped files. Not because memory mapped files are a bad thing but because users will read the memory usage and go crazy over what they see even though it's not really using that much actual physical memory.

There's actually guides out there on the web that tell people judge usage by virtual memory allocated too :(. At least this article gets it right :).

  • jltsiren 1 day ago

    If you use memory-mapped files, cached pages count towards the resident set size of your process. If you use ordinary file I/O, they don't. That behavior has amusing consequences in HPC clusters that monitor the memory usage of each job and kill them if they use more memory than they requested.

  • sedatk 22 hours ago

    > This is what Windows task manager reports

    Just to clarify, Windows Task Manager uses Private Working Set by default for process memory usage which does NOT include shared pages with other processes such as libraries or memory mapped files (hence the name “private”). It only shows the memory that maps to privately allocated physical memory per process. It’s probably closer to Resident Set on Unix.

    You probably meant the memory usage in performance tab but I wanted to clarify in case people mistake it for all memory usage fields.

  • d3Xt3r 22 hours ago

    > Resident size is the most reliable metric

    Actually, Proportional Set Size is more accurate than RSS. See: https://en.wikipedia.org/wiki/Proportional_set_size

    • cb321 22 hours ago

      `procs display` (mentioned elsethread https://news.ycombinator.com/item?id=48788167 ) supports PSS via its %M format code.

      One issue with that relative to RSS is permissions. Historically, all procs could see the RSS used by procs of all other users (at least if they could see the PIDs at all). So, RSS requires no special permissions, but the Linux kernel team decided PSS should not be as promiscuous for whatever reasons (I didn't do a deep dive). So, I'm always having to do (the equivalent of) `sudo pu`.

  • hinkley 20 hours ago

    Resident set size is not the amount of memory that the process wants, it’s how much the OS is willing to give it. So once memory pressure kicks in it stops being representative. I’ve seen this misunderstanding lead to bad decisions a few times. I even went so far to remove this value form charts because a team member was going left when he should have gone right.

WD-42 1 day ago

When I read stuff like this, I come to the realization that even after daily driving Linux for 20+ years I still barely utilize its full potential. Great article.

fractorial 1 day ago

Anyone else feel as if HN is healing? I hope this isn't the walking-ghost era of HN.

  • conqrr 1 day ago

    3 AI related articles on the front page, but one is busting slop. I'm hopeful.

  • wonnage 19 hours ago

    Healing by reverting to seven year old pre-slop articles :)

thijson 1 day ago

For top if you use the > character it will sort by memory usage. I use that sometimes to figure out why my host is becoming laggy. Also you'll see swapd is taking up CPU.

  • yomismoaqui 1 day ago

    I prefer using the more memory friendly M (uppercase) for memory and P (uppercase) for CPU

zepearl 1 day ago

For the ones that don't know "nmon", have a look at it as well! (press "h" to see the list of available monitors - press it again to make it go away, press "q" to quit)

https://nmon.sourceforge.io/pmwiki.php

Especially disk throughput and I/O (keys "d" & "D") can be very useful.

  • Zardoz84 23 hours ago

    very useful tool. I install it on every machine where I have control. I appreciate the "Wide" CPU usage graph, that can handle huge core counts easily

  • shellwizard 19 hours ago

    I know it from some AIX machines that we have at job, also topas comes to mind

wyclif 1 day ago

I've had this bookmarked since 2016, and have referred to it many times over the years.

cb321 22 hours ago

A different usage paradigm from *top that I have come to like better is to do differential ps-like reports and system-wide (like vmstat) reports which leaves everything in your terminal scrollback buffer as in: https://github.com/c-blake/procs { written in the uncommonly efficient, expressive Nim programming language }.

TheChaplain 1 day ago

This is really good!

I use htop often but pretty much only use it to find pid or cpu-culprits, and never really understood the rest.

  • bwnkl 1 day ago

    For pid I find pgrep to be the better suited tool

Maksadbek 9 hours ago
   /*
    * kernel/sched/loadavg.c
    *
    * This file contains the magic bits required to compute the global loadavg
    * figure. Its a silly number but people think its important. We go through
    * great pains to make it work on big machines and tickless kernels.
    */

so is it just silly numbers or important ?

  • leephillips 3 hours ago

    Seems clear to me: it’s a silly number that people think is important. Like the Dow, H-index, GNP, ...

love0972 1 day ago

Very interesting topic,Cool.

MomsAVoxell 1 day ago

s/htop/btop/

You'll be glad you did.

  • allarm 23 hours ago

    What's so good about btop? I personally can't stand its interface, I don't need bells and whistles in my terminal.

    • MomsAVoxell 10 hours ago

      It’s something I put in a very small terminal, hitting the 1,2,3,4,5 key until I get the view I need, just right, and there it sits telling me all during my busy compiles and things, just how max’ing my system is.

      It’s very informative, well designed for a TUI, and shows me everything I need to see without requiring futzing around with the menu bar, or dealing with registration nagging, or notification popups, or any of the other mundane things the non-terminal performance monitors seem to think is necessary to stain my eyeballs…

      • allarm 10 hours ago

        Not arguing here, but htop can do the same, no?

        • MomsAVoxell 8 hours ago

          The way to think about it is that btop is a prettier, more modern version of htop, uses fewer resources, but is in general a better designed-UI. It provides a better view of system resources than htop, imho .. its timeline-centric views especially.

          • LargoLasskhyfv 5 hours ago

            I have both, and while btop can look nice, has some templates to cycle through, it lacks things I'm using in htop: s for stracing, l for listing open files, and x for which of them are locked.

            It also has some templates to cycle through, and can be made to look nice, too. That thing about the resource usage? A few MB more residential? Oh noez! (Maybe depends on compilation options) Only thing coming to mind are too fast updates, compared to btop defaults (Whatever the distro put in there).

            Timelines? Don't really care about them in there. Have other means to get them. Seems gimmicky to me in that scope.

            Only thing missing in htop is n for netstat/sockstat in htop. That would be nice in addition to s,l,x.

            Btop is still installed only to pose sometimes, for some people. Because of the Ooooh Cyber! effect.

            But tbh that works with htop too.

amelius 1 day ago

Nowadays most of my processing happens on the GPU, so htop/top better evolve or become mostly irrelevant because a tool that will support both CPU __and__ GPU will replace it.

  • FpUser 1 day ago

    Irrelevant for you does not mean irrelevant for others

    • amelius 1 day ago

      Nails and hammers are great but most of us have moved on to screws and screwdrivers.

      What good does it do to stick your head in the sand?

      CPUs are great for orchestrating work, GPUs are great for actually doing the work.

      • FpUser 1 day ago

        >"What good does it do to stick your head in the sand?"

        Get the fuck out. I do write for GPU as well. One does not replace the other.

        • justthetop 1 day ago

          For high performance work, gpus have replaced cpus a long time ago.

          • goodmythical 1 day ago

            Not for all definitions of HPC, though.

            No one's doing database management on GPUs. No one's scraping data on GPUs. Can't run VMs on GPUs. Can't run web servers on GPU...

            • FpUser 23 hours ago

              It is sunny in my backyard now. Must be sunny everywhere else

          • kergonath 22 hours ago

            There is plenty of "high performance work" that still requires CPUs.

      • WD-42 1 day ago

        Did you write this comment using your gpu?

        • FpUser 19 hours ago

          Actually modern rendering might involve GPU

      • goodmythical 1 day ago

        >CPUs are great for orchestrating work

        Right, and wouldn't it be really nice if we could check on our orchestrators to make sure their not bottlenecking ops?

        "How come we can fully load the GPUs?" "Idk boss, amelius said htop et al were irrelevant so we can't really investigate"

        • amelius 18 hours ago

          "Use gtop, a tool that shows both cpu and gpu load, and more. I am your boss, you should know this stuff, not me".

      • JdeBP 23 hours ago

        Screws have been around for about 3 millennia at this point. They have patently failed to obviate the use of nails. So by this analogy we can expect the 'Only GPUs do the work.' believers to be still promising this, any day now, about three thousand years hence. (-:

        • amelius 21 hours ago

          Software is getting more complicated and a lot of it depends on both cpu and gpu.

          If you have a systems tool that gives an overview of resources used, then better monitor them both.

          Imho failing to do so is not future-proof. Your opinion might differ.

  • zekrioca 1 day ago

    Stupidest comment ever.

  • sevg 1 day ago

    > Nowadays most of my processing happens on the GPU, so htop/top better evolve or become mostly irrelevant

    If you’re a 3D rendering designer, an ML engineer or a crypto bro, then sure.

    Here are the common workloads (for the average SWE on HN) that use CPU/RAM:

      - compilation/builds
      - language servers and IDEs
      - test suites
      - local containers
      - local databases
      - node tooling
      - browsers
      - data processing
      - compression and encryption
      - searching/indexing
    

    Ok sure, top/htop is totally irrelevant now /s

    • lukan 23 hours ago

      And your browser for instance might crash, if it runs out of gpu memory, which will surprise you if you only look for cpu/ram.

      (Happened to me)

  • shellwizard 19 hours ago

    There's intel_gpu_top for Intel iGPUs, although it's very limited and not a great UX

  • cwillu 14 hours ago

    top can add another column without “evolving”.