►
From YouTube: Connection pool metrics demo
Description
A demo for the new connection pool metrics recorded in GitLab (https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/153), because the setup to test this is quite involved
A
During
over
edits,
the
reason
I'm
demoing
the
monitoring,
even
though
monitoring
itself
isn't
that
interesting
is
just
because
the
steps
to
set
this
up
are
quite
involved.
So
what
I
want
to
do?
Or
what's
the
connection
pool
usage
to
our
Postgres
databases
and
get
loud
has
three
ways
you
can
connect
to
a
Postgres
database.
First
of
all,
there's
the
main
one
which
is
used
for
the
application
by
default.
A
So
any
sort
of
standard
install
that
get
lab
will
at
least
have
one
the
what
we
can
call
active
record
base
connection
for
geo
on
the
secondary
nodes.
We
have
this
tracking
database
using
a
foreign
data
wrapper.
You
can
see.
I've
got
a
Geo
set
up
here
and
I'm
on
a
secondary
node,
there's
nothing
to
think,
because
I
don't
need
anything
to
sync
for
what
I'm
doing
here
and
then
finally,
there's
a
feature
we
have,
which
is
called
database
load
balancing
where
you
can
add
secondary
database
servers
to
handle
some
HTTP
requests.
A
If
those
HTTP
requests
to
only
perform
reads
so
as
soon
as
an
HTTP
request
performs
a
write,
it
goes
to
the
primary.
But
as
long
as
it's
only
performing
reads
from
the
database,
it
will
go
to
the
secondaries
and
it
will
just
be
balanced
between
those
so
to
set
this
up.
Obviously,
I
need
to
set
up
Geo
once
you've
got
Geo
set
up,
setting
up
database
load,
balancing
it's
fairly
trivial,
because
geo
requires
at
least
one
database
replica.
A
So
you
can
just
point
the
load
balancing
host
to
the
other
database
node
to
the
one
you're
using
and
you've
got
some
load
balancing
setup,
but
that's
not
necessarily
what
you
should
do,
but
for
testing
it.
That's
totally
fine,
so
yeah,
here
I'm
on
the
secondary
node.
This
is
the
Prometheus
installed
for
the
secondary
node.
So
this
should
have
everything
available.
I'm,
gonna,
look
at
the
connection
pool
busy
stats.
A
The
graphs
not
super
interesting,
because
I
just
died
this
just
before
this
demo,
but
you
can
see
that
we
have
values
for
active
record
base,
which
is
the
main
connection
on
sidekick
and
the
two
Puma
threats.
We
have
geo
tracking
base
in
the
same
places
and
we
also
have
database
load
balancing
hosts
on
the
prima
threats
only
because,
like
I
mentioned
it's
my
Houston
sidekick.
A
The
reason
that
the
labels
have
the
class
and
the
host
is
because
the
class
is
useful
for
people
wanting
to
know
what
what
the
connection
is
and
the
host
is
useful
for
disambiguation,
so
active
record
base
can
be
different
on
get
web
comm
on
our
web
and
sidekick
nodes
and
obviously
database
load
balancing
can
have
multiple
hosts.
So
if
I
had
a
couple
more
host
set
up
here,
the
only
way
I
would
be
able
to
do
something
q8.
Those
is
by
the
host
value.
A
These
are
using
IPS
here
because
that's
what
I'm
using,
but
if
they
were
using
domain,
if
they
were
using
names,
then
there
would
be
using
names
and
the
other
thing
there
is
the
cardinality
shouldn't
be
too
bad,
because
there's
only
so
many
database
load,
balancing
hosts
you
can
have
and
class
can
only
be
one
of
these
three
things.
So
that's
my
demo.