link::
Address of client connection the server is paired with.
-backend_pid::
- Pid of backend server process. In case the server is another PgBouncer,
- it will be a random number associated with this connection.
+remote_pid::
+ Pid of backend server process. In case connection is made over
+ unix socket and OS supports getting process ID info, it's
+ OS pid. Otherwise it's extracted from cancel packet server sent,
+ which should be PID in case server is Postgres, but it's a random
+ number in case server it another PgBouncer.
==== SHOW CLIENTS; ====
link::
Address of server connection the client is paired with.
-backend_pid::
- Random number sent to client as "backend process pid".
- Usually unique, but not quaranteed.
+remote_pid::
+ Process ID, in case client connects over UNIX socket
+ and OS supports getting it.
==== SHOW POOLS; ====
"type", "user", "database", "state",
"addr", "port", "local_addr", "local_port",
"connect_time", "request_time",
- "ptr", "link", "backend_pid",
+ "ptr", "link", "remote_pid",
"recv_pos", "pkt_pos", "pkt_remain",
"send_pos", "send_remain",
"pkt_avail", "send_avail");
static void socket_row(PktBuf *buf, PgSocket *sk, const char *state, bool debug)
{
int pkt_avail = 0, send_avail = 0;
- int backend_pid;
+ int remote_pid;
char ptrbuf[128], linkbuf[128];
char l_addr[PGADDR_BUF], r_addr[PGADDR_BUF];
IOBuf *io = sk->sbuf.io;
/* get pid over unix socket */
if (pga_is_unix(&sk->remote_addr))
- backend_pid = sk->remote_addr.scred.pid;
+ remote_pid = sk->remote_addr.scred.pid;
else
- backend_pid = 0;
+ remote_pid = 0;
/* if that failed, get it from cancel key */
- if (is_server_socket(sk) && backend_pid == 0)
- backend_pid = be32dec(sk->cancel_key);
+ if (is_server_socket(sk) && remote_pid == 0)
+ remote_pid = be32dec(sk->cancel_key);
pktbuf_write_DataRow(buf, debug ? SKF_DBG : SKF_STD,
is_server_socket(sk) ? "S" :"C",
l_addr, pga_port(&sk->local_addr),
sk->connect_time,
sk->request_time,
- ptrbuf, linkbuf, backend_pid,
+ ptrbuf, linkbuf, remote_pid,
io ? io->recv_pos : 0,
io ? io->parse_pos : 0,
sk->sbuf.pkt_remain,