[Pgpool-general] pgpool show status used connections

Heiko L. heikol at fh-lausitz.de
Wed Nov 7 12:22:02 UTC 2007


Hallo *!

mission:
- To the diagnosis a connecting-problem
  should be write "used number of connections" to logfile each 10 min.

- version 3.1.1(kawakawa)

- details s. "test log_connections_count"

How to print-out "number of connections"?

regards Heiko

-----------------------------------------------------------------------
- test log_connections_count

  - add line pool_log to child.c:do_child()

    411                 if ( pool_config.child_max_connections > 0 )
    412                         connections_count++;
    413
    414                 pool_log("do_child, add connection %d",
connections_count);
    415                 /* check if maximum connections count for this
child reached */
    416                 if ( ( pool_config.child_max_connections > 0 ) &&
    417                         ( connections_count >=
pool_config.child_max_connections ) )

# /etc/init.d/pgpool start

Nov  7 08:33:25 mail pgpool: 2007-11-07 08:33:25 LOG:   pid 14594:
do_child, add connection 0
....

Nov  7 09:25:07 mail pgpool: 2007-11-07 09:25:07 LOG:   pid 15824:
do_child, add connection 0
Nov  7 09:25:07 mail pgpool: 2007-11-07 09:25:07 LOG:   pid 16240:
do_child, add connection 0
Nov  7 09:25:07 mail pgpool: 2007-11-07 09:25:07 LOG:   pid 16342:
do_child, add connection 0

    - Result: connections_count is always eq 0

  - suggestion: variable connections_count is not defined as global.
    -> so that connections_count can be never ge 1

  - do_child() called by main.c:fork_a_child() only




More information about the Pgpool-general mailing list