guider icon indicating copy to clipboard operation
guider copied to clipboard

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

Open sattishv opened this issue 2 years ago • 5 comments
trafficstars

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.)

sattishv avatar Jan 03 '23 07:01 sattishv

@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
----------------------------------------------------------------------------------------------------------------------------------------------------------

iipeace avatar Jan 03 '23 13:01 iipeace

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

sattishv avatar Jan 05 '23 05:01 sattishv

@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.

iipeace avatar Jan 06 '23 00:01 iipeace

Thanks for the inputs. Is the preparations to translate the java symbols are listed anywhere If so could you please share. Thanks in advance

On Fri, Jan 6, 2023 at 5:37 AM Peace Lee @.***> wrote:

@sattishv https://github.com/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.

— Reply to this email directly, view it on GitHub https://github.com/iipeace/guider/issues/301#issuecomment-1372954445, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY2VGPDNXBH4RKF2LSZ633WQ5O3LANCNFSM6AAAAAATPMUNZY . You are receiving this because you were mentioned.Message ID: @.***>

-- with regards,

Sattish 9940080070

sattishv avatar Jan 06 '23 10:01 sattishv

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

iipeace avatar Jan 10 '23 13:01 iipeace