aristocratos / bashtop

Linux/OSX/FreeBSD resource monitor
Apache License 2.0
10.76k stars 549 forks source link

[QUESTION] What are the advantages of using psutil on linux servers like Ubuntu? #194

Closed Memphizzz closed 3 years ago

Memphizzz commented 3 years ago

As stated above I'd like to know what the advantages of using psutil are and what is being used if psutil is not installed on a Ubuntu server?

Thanks in advance!

LethargicLeprechaun commented 3 years ago

I like to use psutil because of the huge range of functionality it offers. For example, you can view the memory usage of processes. There is a particular python profiler called memory-profiler that analyses the memory consumption of a python script line-by-line(made possible by psutil).

If psutil wasn't installed I'd probably have to use htop or ps(to look at the memory usage).

Memphizzz commented 3 years ago

I was actually thinking about the performance impact between psutil and whatever the alternative is. @aristocratos Any insight on this?

aristocratos commented 3 years ago

@Memphizzz Not using psutil uses ps and reads directly from /proc which isn't very efficient in bash.

Regardless I would suggest you use BpyTop instead, since it's alot faster than bashtop regardless of method and also in active development.

Memphizzz commented 3 years ago

Oh wow, thanks for letting me know @aristocratos !