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

Is it possible to record the process usage based on process id #301

Open
sattishv opened this issue Jan 3, 2023 · 5 comments
Open

Is it possible to record the process usage based on process id #301

sattishv opened this issue Jan 3, 2023 · 5 comments

Comments

@sattishv
Copy link

sattishv commented Jan 3, 2023

Team,
We deploy multiple node process in the same host as dockerized deployment. If we would like to monitor individual node process from the host, does guider provide an option to specify the process id or do we have other ways by which we can monitor individual process
Note: (in our host all our node process will have the same name the only variance is process id.)

@iipeace
Copy link
Owner

iipeace commented Jan 3, 2023

@sattishv

-g option is used to specify PIDs and COMMs in top mode.

 $ guider top -g PID1, PID2, COMM

If you want to distinguish each node process,
What do you think about using -e NG option to show NAMESPACE and CGROUP info.

 $ guider top -g node -e NG

==========================================================================================================================================================
           Process ( PID/PPID/  Nr/ Pri)| CPU(Usr/Ker/Dly)| VSS( RSS/Txt/Shr/Swp)| Blk(  RD/  WR/NrFlt)| SID | USER | FD | LifeTime|       Parent        |
----------------------------------------------------------------------------------------------------------------------------------------------------------
              node (2385/2384/   1/C  0)|  99( 33/ 65/  -)|   6(   1/  0/  0/  0)|   0(   -/   -/    0)| 1941|  root|  64| 00:01:27|             sh(2384)|
                              NAMESPACE | net:4026531992, uts:4026532191, ipc:4026532192, pid:4026532193, user:4026531837, mnt:4026532190, cgroup:4026531835
                                 CGROUP | cpu:/test
----------------------------------------------------------------------------------------------------------------------------------------------------------

@sattishv
Copy link
Author

sattishv commented Jan 5, 2023

Thanks @LiPeace for the quick response. Will try specifying the NG option. Does guider differ in providing details when installed outside the container(inside host) compared to inside the container. Do we have any difference in the way in collects data (inside or outside the conatiner). Also does guider support java applications

@iipeace
Copy link
Owner

iipeace commented Jan 6, 2023

@sattishv
the NG option means a mix of N option and G option.
N option means showing namespace, G option means showing cgroups for each process.

all processes inside container can't see all processes, directories and files, and specific resources in host.
it's about linux namespace not guider's implementation.

Guider supports java for function tracing and monitoring, but it requires some preparations to see java symbols for target process.

@sattishv
Copy link
Author

sattishv commented Jan 6, 2023 via email

@iipeace
Copy link
Owner

iipeace commented Jan 10, 2023

please check below instructions about function profiling for various language.

    - Monitor native and JIT-compiled function calls for specific threads
        * Qt:
            - run the target with "QV4_PROFILE_WRITE_PERF_MAP=1" environment variable (version >= 5.6.0)
        * Node:
            - run the target with "--perf-basic-prof" option (version >= 0.11.13, map file growth endlessly)
            - run the target with "--perf-basic-prof-only-functions" option (version >= 4.4.0)
        * Java:
            1. install perf-map-agent
            2. run the target with "-XX:+PreserveFramePointer -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints" option
            3. set environment with "export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")" command
            4. create a map file with "perf-map-agent/bin/create-java-perf-map.sh PID" command
        * Mono:
            - run the target with "--jitmap" option
        * .NET Core:
            - run the target with "COMPlus_PerfMapEnabled=1" environment variable
                
        # ./guider utop -g [TID|COMM] -q JITSYM -H

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants