To get PID for the remote user

progress_in

New Member
In a client-server architecture, when we connect to a database through remote client (can be the application server), the PID for the process (using top command) on the database server is same as the PID on the application box.

However promon utility shows PID for the remote process as 0 or - (as suggested by the progress documentation)

We can list the PID for the user using the proshut <dbname> -C list , however these PID's are not present in the top command output.

Summary for the problem : We are generating a list of process from the top command and sort them as per the CPU usage % which looks like as below

5349 root 15 0 973m 63m 62m S 8.2 0.1 105:09.38 /usr/dlc102b/bin/_mprosrv <dbname> -m1
6813 root 15 0 973m 837m 837m S 2.3 1.7 6:05.10 /usr/dlc102b/bin/_mprosrv <dbname> -m1
19826 root 16 0 11796 2092 776 R 2.0 0.0 0:00.40 top
5563 root 15 0 973m 67m 66m S 1.6 0.1 21:08.09 /usr/dlc102b/bin/_mprosrv <dbname> -m1
5567 root 15 0 973m 64m 64m S 1.6 0.1 16:30.78 /usr/dlc102b/bin/_mprosrv <dbname> -m1
4900 root 15 0 973m 62m 61m S 1.0 0.1 17:56.93 /usr/dlc102b/bin/_mprosrv <dbname> -m1
6616 root 15 0 973m 60m 59m S 0.7 0.1 8:25.93 /usr/dlc102b/bin/_mprosrv <dbname> -m1
6620 root 15 0 973m 60m 59m S 0.7 0.1 6:56.02 /usr/dlc102b/bin/_mprosrv <dbname> -m1
5353 root 15 0 973m 61m 61m S 0.3 0.1 5:13.52 /usr/dlc102b/bin/_mprosrv <dbname> -m1
5473 root 15 0 973m 289m 288m S 0.3 0.6 1:11.60 /usr/dlc102b/bin/_mprosrv <dbname> -m1

Now we would like to know the list of progress users for the PID say 5349 ( -Mn 101 -Ma 5 in db startup script), so we can check for the query/procedure/hostname for the user

Is there a way we can list the users for the particular progress database server ( in our case 5 is max per server)

Thanks,
 
It is more readable if you put screen output within CODE tags:

Code:
 5349 root      15   0  973m  63m  62m S  8.2  0.1 105:09.38 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 6813 root      15   0  973m 837m 837m S  2.3  1.7   6:05.10 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 19826 root     16   0 11796 2092  776 R  2.0  0.0   0:00.40 top
 5563 root      15   0  973m  67m  66m S  1.6  0.1  21:08.09 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 5567 root      15   0  973m  64m  64m S  1.6  0.1  16:30.78 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 4900 root      15   0  973m  62m  61m S  1.0  0.1  17:56.93 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 6616 root      15   0  973m  60m  59m S  0.7  0.1   8:25.93 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 6620 root      15   0  973m  60m  59m S  0.7  0.1   6:56.02 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 5353 root      15   0  973m  61m  61m S  0.3  0.1   5:13.52 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 5473 root      15   0  973m 289m 288m S  0.3  0.6   1:11.60 /usr/dlc102b/bin/_mprosrv <dbname> -m1
 
In a client-server architecture, when we connect to a database through remote client (can be the application server), the PID for the process (using top command) on the database server is same as the PID on the application box.

I'm not sure what you mean by "the PID for the process on the database server is the same as the PID on the application box". A remote client that is running on a a box other than the database server has a PID on the box on which it is running. Therefore it has no PID on the database server because there is no process on the database server for that database user. It just connects to a server via a socket.

However promon utility shows PID for the remote process as 0 or - (as suggested by the progress documentation)

Yes.

We can list the PID for the user using the proshut <dbname> -C list , however these PID's are not present in the top command output.

They shouldn't be. They aren't present because they aren't processes on the box where you're running top.

Summary for the problem : We are generating a list of process from the top command and sort them as per the CPU usage % which looks like as below

5349 root 15 0 973m 63m 62m S 8.2 0.1 105:09.38 /usr/dlc102b/bin/_mprosrv <dbname> -m1
6813 root 15 0 973m 837m 837m S 2.3 1.7 6:05.10 /usr/dlc102b/bin/_mprosrv <dbname> -m1
19826 root 16 0 11796 2092 776 R 2.0 0.0 0:00.40 top
5563 root 15 0 973m 67m 66m S 1.6 0.1 21:08.09 /usr/dlc102b/bin/_mprosrv <dbname> -m1
5567 root 15 0 973m 64m 64m S 1.6 0.1 16:30.78 /usr/dlc102b/bin/_mprosrv <dbname> -m1
4900 root 15 0 973m 62m 61m S 1.0 0.1 17:56.93 /usr/dlc102b/bin/_mprosrv <dbname> -m1
6616 root 15 0 973m 60m 59m S 0.7 0.1 8:25.93 /usr/dlc102b/bin/_mprosrv <dbname> -m1
6620 root 15 0 973m 60m 59m S 0.7 0.1 6:56.02 /usr/dlc102b/bin/_mprosrv <dbname> -m1
5353 root 15 0 973m 61m 61m S 0.3 0.1 5:13.52 /usr/dlc102b/bin/_mprosrv <dbname> -m1
5473 root 15 0 973m 289m 288m S 0.3 0.6 1:11.60 /usr/dlc102b/bin/_mprosrv <dbname> -m1

Now we would like to know the list of progress users for the PID say 5349 ( -Mn 101 -Ma 5 in db startup script), so we can check for the query/procedure/hostname for the user

Is there a way we can list the users for the particular progress database server ( in our case 5 is max per server)

So to restate the problem, "which users are connected to the server with PID 5349?"

Answer:
In promon 1 | 1 or promon | R&D | 1 | 17 get the server number of the server PID in question.
Look at promon 1 | 1 or promon | R&D | 1 | 4 | 6 to find which users are connected to that server number.
 
So now we have list of high resource consuming users, Would like to know if we able to get the list of procedures/code base/functions causing high load.

Want to know what's code running by the user causing high load

Thanks,
 
What I have found that works better on UNIX than the client statement cache is to generate a protrace file with a kill -s SIGUSR1 <pid>.

A protrace file will be created in the current working directory - use lsof if you don't know where that is - and will be called protrace.pid

You will see a section with the full ABL stack like

** ABL Stack Trace **

--> SETL30-I SETL30.P (/share/SETL30.r) at line 6256
SETL30.P (/share/SETL30.r) at line 2446
SMEAPISETL1.P (/smartview/SMEAPISETL1.r) at line 812
SMEAPISETL0.P (/smartview/SMEAPISETL0.r) at line 1371

 
If your application server is Windows-based you can run proGetStack <pid> in proenv. This does the same as kill -SIGUSR1 in Unix. There is also a proGetStack shell script in Unix.

Either way, it produces the file protrace.<pid> as cj pointed out. Very useful stuff.
 
Back
Top