Menu

#6 TOP stats - reporting owner of processes

wont-fix
nobody
None
5
2022-11-14
2016-12-27
No

Hello,

Could it be possible as a feature request for next releases to report in TOP section the Unix user that owns the process collected ?

Currently TOP collects all the usefull information but the Unix owner.

Thank you very much for this great tool !

Regards,

Guilhem

Discussion

  • Nigel Griffiths

    Nigel Griffiths - 2016-12-28

    Hi Guilhem,
    I am relucant to add this process UID for the following reasons:
    1) The process owner is not a performance statisitc.
    2) It does not change so reporting it in every snapshot for every process seems wasteful in file size.
    3) I don't see the point as move Linux machines are either a PC with one logged on user or a server machine with no users logged on and all the interesting stuff is running as root.
    4) Or a particular application (RDBMS or Web server or ...) only runs as one owner account.
    5) I don't want to break down stream graphing tools for such unimportant data.
    6) It is non-trivial to add this feature as the /proc/stat file (the prime source of process information) does not contain this information so it is not easy to get the users name or even user ID.

    Have you a clear and frequent case, where this would be important informtion?

    Cheers, Nigel Griffiths

     
  • Guilhem Marchand

    Hello Nigel,

    Thank you for your very quick answer.

    I am the developer and maintainer of a Splunk application that uses Nmon to collect performance and inventory data from AIX, Linux and Solaris (using sarmon):

    https://splunkbase.splunk.com/app/1753/
    http://nmon-for-splunk.readthedocs.io/en/latest/

    As such this is a feature request I often received from users monitoring Linux systems.
    It is a common (and good) practice to run software on unprivileged Unix users, collecting the Unix username (or UID) in TOP would allow charting resources usage (CPU, Memory...) on running systems over Unix users.
    Most of the time, charting over command invocations provides the essential answer, but if you are running multiple softwares on a Production server, this is can also be very interesting to group those command invocation / PIDs over the process owners, for trouble shooting, capacity planning.

    As well, for for troubleshooting purposes, human interfaces dealing with TOP data allows people identifying PIDs responsible for a peak consumption with drill-down features, collecting the Unix owner of processes can be a supplementary information that accelerates the identification of processes on systems.

    I do agree that dedicated servers (point 4) run most of the time only one owner account as they are dedicated to run one major software, however there are always third party tools (third party schedulers, asset manager...) that run on top of servers, and will mostly using dedicated Unix users.
    As well, Linux administrators often own an account on servers, they can sometimes be responsible for consumption, identifying the process owner makes senses for that case too.

    I thought this could be an information easy to collect, off course if this is not the case and you do think that collecting this information has not enough value compared to required work to achieve, feel free to ignore my feature request.

    Cheers,

    Guilhem

     
  • Nigel Griffiths

    Nigel Griffiths - 2016-12-29

    Hi Guilhem,
    The User ID can be found in /proc/PID/status on the line starting Uid the 1st number is the regular User ID then you have to use /etc/passwd to convert to a User Name.

    As this is an unusual request, I suggest we use a nmon External Data Collector running along side nmon.
    See Question 57 from the nmon FAQ = http://nmon.sourceforge.net/pmwiki.php?n=Site.NmonFAQ

    NMON_START would creat the empty file.
    NMON_SNAP would append this output: cat /proc/[0-9]*/status | egrep "^Pid|^Uid"
    NMON_END would merge each pair of lines (awk perhaps) the sort -n and run uniq then sed the Uid to the Users name and you have a map of PID to User.

    Having run "time" on that cat + grep pair and compared to ps, I found the ps to be taking less CPU cycles. The server was idle but some how Linux (Ubuntu 16.04.01) has 350 processes running - the bulk are kernel proesses.

    Alternative and less work
    NMON_START would creat the empty file.
    NMON_SNAP would append this output: ps -Ao pid,user
    NMON_END would sort -n and run uniq then you have a map of PID to User

    You could also look at ps and select any further collumns you fancy.
    I am assuming here you are letting the nmon capture run to completion and post processing.
    This would work for nmon on AIX and Linux.
    I am not the source code owner for nmon on AIX - to add a feature would need a Request for Enhancement (RFE), a business case and lots of pressure and luck!

    I might add this to the FAQ as its generally helpful.
    I could be placed at the end of the nmon file - perhaps making lines start with (say) BBBU so its treated as configuration data for your look up feature.

    Cheers, Nigel

    ps: Took a look at your splunk app website. Looks very interesting but I would never get a splunk licence cost passed my boss. A video with sound and a worked example of using graphs to solve a performance issue would help. The pictures / graphs are too small on my laptop to see the graphs titles and units etc. but they do look pretty :-)

     
  • Guilhem Marchand

    Hello Nigel,

    Thank you for your reply, as always, very interesting !
    I didn't know about that great FAQ (and it's been some years now I'm looking at everything related to Nmon sic!), I'm gonna have a good look at it.

    Best wishes for the festive season!

    Cheers

    Guilhem

    ps:

    A video with sound: https://www.youtube.com/watch?v=-0H-CJDIGDI&t=5s (my accent is, I'm afraid a bit terrible, I haven't yet releases new videos ;-)

    A flickr gallery (some pictures are a bit out of date, I need to update this)
    https://flic.kr/s/aHskFZcQBn

    Finally, note that you can easily get a 10GB Splunk developper license for free, you just need to create an account and request it: http://dev.splunk.com/page/developer_license_sign_up

     
  • Nigel Griffiths

    Nigel Griffiths - 2022-11-14
    • status: open --> wont-fix
     

Log in to post a comment.