Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htop too slow on large server #1535

Open
NikolaBorisov opened this issue Sep 11, 2024 · 3 comments
Open

htop too slow on large server #1535

NikolaBorisov opened this issue Sep 11, 2024 · 3 comments
Labels
enhancement Extension or improvement to existing feature Linux 🐧 Linux related issues question ❔ Further information is requested support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead.

Comments

@NikolaBorisov
Copy link

When I try using htop on a server with around 200 cores and 2TB of memory (H100x8 server) htop is super super slow.
It shows black screen for about 60s before showing anything on the screen. I tried the 3.0.3 version as well as the latest master from source. I tried disabling the patch from this issue: #1484 and it didn't help.

Server has 383K threads which is a lot ;)

Is there anything I can do to debug the slowness?

@BenBE
Copy link
Member

BenBE commented Sep 11, 2024

Can you press Shift+H (Toggle userland thread display) or Shift+K (Toggle kernel thread display) and check if this helps?

Also disabling the "library size" column, mentioned in #1484 may help (basically, everything that avoids reading the maps file). Also disabling the check for outdated binaries should help.

Finally, with that many processes in place, I'm not quite sure how the tree sorting performs. You can toggle this by pressing T if necessary.

If these steps don't help it would be nice to take a look at a flame graph using perf or some other tool like callgrind.

@BenBE BenBE added enhancement Extension or improvement to existing feature question ❔ Further information is requested support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead. Linux 🐧 Linux related issues labels Sep 11, 2024
@NikolaBorisov
Copy link
Author

NikolaBorisov commented Sep 11, 2024

Shift+H helped the most. The refresh rate became close 6 sec. It is still very laggy and not nice to use especially because you have to wait long time for it to start. I could not find the "library size" column I disabled the outdated binaries feature.
I was not using tree sort by default enabling it did not change much. htop now uses around 50+% cpu from one core. But still quite laggy. I captured perf but it looks like it has no debug symbols.

perf.data.zip]

Anything else I can try? How can I start in the Shift+H mode?

@BenBE
Copy link
Member

BenBE commented Sep 12, 2024

Without debug symbols the perf data is kinda hard to work with. Could you try to compile htop from source?

$ ./autogen.sh
$ ./configure CFLAGS="-Og -g"
$ make

You can then start ./htop from the build directory. More details on the build can be found in the readme.

But based on your reported success with Shift+H this hints at the sheer number of threads (and processes) taking some time to be read. Once reading userland threads is disabled, you can just close htop with q and it's saved to the settings. The long delay at the start should usually be better there too.

That initial blank screen comes from htop needing to refresh the process list twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Extension or improvement to existing feature Linux 🐧 Linux related issues question ❔ Further information is requested support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead.
Projects
None yet
Development

No branches or pull requests

2 participants