Monitoring Max Connections Per Broker

maday15

Member
Hello, I am currently on OE 10.2bSP8 on AIX and I was going over my startup parameters and started thinking about my connections. I am monitoring for the -n parameter to ensure I don't get close to my max connections (-n 3280), however the majority of my connections are through my primary broker (4GL) and that has settings for -Mpb of 230 and -Ma of 10 which is only 2300. I below that number of connections but could see that being reached over the next year or two if we continue to grow. I obviously could just keep manually checking and adjusting the number but I like to have automated monitoring/alerting in case I forget or I leave the company and my replacement doesn't manually check.

So my question - is there a way to monitor the number of users connected to a specific broker? I assume it's all custom scripting but is there a command to run or a way to get a list of users by broker? I know there is in promon but I'd need a way to put that data in a file and then do some calculations.

Thanks!
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
This program displays the servers and the clients connected to each. It is taken from a larger program where I cached _connect to avoid reading it multiple times, but you don't have to do that. If you don't want the client details, you could just change the inner FOR EACH to count the connected clients and display the count.

The resulting frame is fairly wide, so you'll need a terminal with at least 175 columns if you're outputting to the screen.
Code:
/* display clients by server */

define temp-table ttConnect no-undo
  like dictdb._connect
  index srv _connect-server
.

define buffer bf-ttconnect for ttConnect.

for each dictdb._connect no-lock:
  create ttConnect.
  buffer-copy _connect to ttConnect.
end.

for each dictdb._servers no-lock
  by _server-type desc
  by _server-portnum:

  find bf-ttconnect no-lock where bf-ttconnect._connect-id = _servers._server-id no-error.

  display
    _Server-Num                  label "Serv#"       format ">>9"
    _Server-Type
    bf-ttconnect._connect-type   label "SrvTyp"                       when available( bf-ttconnect )
    if _Server-PortNum < 0 then _Server-PortNum + 65536 else _Server-PortNum label "Port #" format ">>>>9"   /* OE doesn't display port #s >32767 properly */
    _Server-Pid
    _Server-MaxUsers
    _Server-CurrUsers            label "Curr Users"  format ">>>"
    _Server-PendConn             label "Pend Conn"   format ">>>"
    _Server-Logins                                   format ">>>,>>9"
   with frame srv down no-error
  .
  down with frame srv.

  for each ttConnect no-lock where ttConnect._connect-server = _servers._server-num:
    display
      ttConnect._connect-usr
      ttConnect._connect-name                         format "x(12)"              column-label "User name"
      ttConnect._connect-type
      ttConnect._connect-clienttype                                               column-label "Cl type"
      ttConnect._connect-device                       format "x(16)"
      ttConnect._connect-ipaddress                    format "x(15)"
      ttConnect._connect-batch                                                    column-label "Batch"
      ttConnect._connect-pid                                                      column-label "Client PID"
     with frame srv no-error
    .
    down with frame srv.
  end.

end.
 
Top