pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedFinding detailed information about LOCKS
7+ messages / 4 participants
[nested] [flat]
* Finding detailed information about LOCKS
@ 2024-05-03 05:24 Siraj G <tosiraj.g@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Siraj G @ 2024-05-03 05:24 UTC (permalink / raw)
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Hello Admins!
I come from Oracle background. In Oracle there is a licensed feature
(Diagnostics + Tuning) upon using which the system keeps historic session
records, which gives a better way to find out locking related details- like
the blocking session, total sessions blocked and the time the blocking
event was active. I am finding it a little hard in PgSQL to find this
information.
I am seeking help in finding a detailed analysis on the locks that happened
yesterday, 2 days back or in the last week. Can someone assist please.
Regards
Siraj
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Finding detailed information about LOCKS
@ 2024-05-03 06:16 Laurenz Albe <laurenz.albe@cybertec.at>
parent: Siraj G <tosiraj.g@gmail.com>
0 siblings, 2 replies; 7+ messages in thread
From: Laurenz Albe @ 2024-05-03 06:16 UTC (permalink / raw)
To: Siraj G <tosiraj.g@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> I come from Oracle background. In Oracle there is a licensed feature (Diagnostics + Tuning)
> upon using which the system keeps historic session records, which gives a better way
> to find out locking related details- like the blocking session, total sessions blocked
> and the time the blocking event was active. I am finding it a little hard in PgSQL
> to find this information.
>
> I am seeking help in finding a detailed analysis on the locks that happened yesterday,
> 2 days back or in the last week. Can someone assist please.
PostgreSQL doesn't keep historical information on these things.
You need a monitoring tool like pgwatch2 that takes regular snapshots of these data
and allows you to access this information.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Finding detailed information about LOCKS
@ 2024-05-03 06:22 Wasim Devale <wasimd60@gmail.com>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 1 reply; 7+ messages in thread
From: Wasim Devale @ 2024-05-03 06:22 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Siraj G <tosiraj.g@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Can we not use pgbadger?
On Fri, 3 May, 2024, 11:46 am Laurenz Albe, <laurenz.albe@cybertec.at>
wrote:
> On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> > I come from Oracle background. In Oracle there is a licensed feature
> (Diagnostics + Tuning)
> > upon using which the system keeps historic session records, which gives
> a better way
> > to find out locking related details- like the blocking session, total
> sessions blocked
> > and the time the blocking event was active. I am finding it a little
> hard in PgSQL
> > to find this information.
> >
> > I am seeking help in finding a detailed analysis on the locks that
> happened yesterday,
> > 2 days back or in the last week. Can someone assist please.
>
> PostgreSQL doesn't keep historical information on these things.
>
> You need a monitoring tool like pgwatch2 that takes regular snapshots of
> these data
> and allows you to access this information.
>
> Yours,
> Laurenz Albe
>
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Finding detailed information about LOCKS
@ 2024-05-03 06:26 Laurenz Albe <laurenz.albe@cybertec.at>
parent: Wasim Devale <wasimd60@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Laurenz Albe @ 2024-05-03 06:26 UTC (permalink / raw)
To: Wasim Devale <wasimd60@gmail.com>; +Cc: Siraj G <tosiraj.g@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
On Fri, 2024-05-03 at 11:52 +0530, Wasim Devale wrote:
> On Fri, 3 May, 2024, 11:46 am Laurenz Albe, <laurenz.albe@cybertec.at> wrote:
> > On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> > > I come from Oracle background. In Oracle there is a licensed feature (Diagnostics + Tuning)
> > > upon using which the system keeps historic session records, which gives a better way
> > > to find out locking related details- like the blocking session, total sessions blocked
> > > and the time the blocking event was active. I am finding it a little hard in PgSQL
> > > to find this information.
> > >
> > > I am seeking help in finding a detailed analysis on the locks that happened yesterday,
> > > 2 days back or in the last week. Can someone assist please.
> >
> > PostgreSQL doesn't keep historical information on these things.
> >
> > You need a monitoring tool like pgwatch2 that takes regular snapshots of these data
> > and allows you to access this information.
>
> Can we not use pgbadger?
pgBadger can only collect what is in the log file. How would you get that information
into the log file? The best you can get in the log file is the information from
"log_lock_waits = on", which is information about situations where somebody had to
wait for a lock for more than a second. Definitely useful, but capturing "pg_stat_activity"
snapshots will provide more infrmation.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Finding detailed information about LOCKS
@ 2024-05-03 06:30 Wasim Devale <wasimd60@gmail.com>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 0 replies; 7+ messages in thread
From: Wasim Devale @ 2024-05-03 06:30 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Siraj G <tosiraj.g@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Yes this will log in the log file that will be seen pgbadger report under
locks section. We can also mention deadlock_timeout and
max_locks__per_transaction.
Thanks
Wasim
On Fri, 3 May, 2024, 11:56 am Laurenz Albe, <laurenz.albe@cybertec.at>
wrote:
> On Fri, 2024-05-03 at 11:52 +0530, Wasim Devale wrote:
> > On Fri, 3 May, 2024, 11:46 am Laurenz Albe, <laurenz.albe@cybertec.at>
> wrote:
> > > On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> > > > I come from Oracle background. In Oracle there is a licensed feature
> (Diagnostics + Tuning)
> > > > upon using which the system keeps historic session records, which
> gives a better way
> > > > to find out locking related details- like the blocking session,
> total sessions blocked
> > > > and the time the blocking event was active. I am finding it a little
> hard in PgSQL
> > > > to find this information.
> > > >
> > > > I am seeking help in finding a detailed analysis on the locks that
> happened yesterday,
> > > > 2 days back or in the last week. Can someone assist please.
> > >
> > > PostgreSQL doesn't keep historical information on these things.
> > >
> > > You need a monitoring tool like pgwatch2 that takes regular snapshots
> of these data
> > > and allows you to access this information.
> >
> > Can we not use pgbadger?
>
> pgBadger can only collect what is in the log file. How would you get that
> information
> into the log file? The best you can get in the log file is the
> information from
> "log_lock_waits = on", which is information about situations where
> somebody had to
> wait for a lock for more than a second. Definitely useful, but capturing
> "pg_stat_activity"
> snapshots will provide more infrmation.
>
> Yours,
> Laurenz Albe
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Finding detailed information about LOCKS
@ 2024-05-03 14:03 Wetmore, Matthew (CTR) <Matthew.Wetmore@evernorth.com>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 1 reply; 7+ messages in thread
From: Wetmore, Matthew (CTR) @ 2024-05-03 14:03 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; Siraj G <tosiraj.g@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
If you can't get pgwatch2
Cron job that runs every hour:
grep -E "lock" (or whatever search term) postgresql.log > lock_history.txt
Or something to that effect, not as good as the tool obviously, but a workingperson's solution.
-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Thursday, May 2, 2024 11:16 PM
To: Siraj G <tosiraj.g@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: [EXTERNAL] Re: Finding detailed information about LOCKS
On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> I come from Oracle background. In Oracle there is a licensed feature
> (Diagnostics + Tuning) upon using which the system keeps historic
> session records, which gives a better way to find out locking related
> details- like the blocking session, total sessions blocked and the
> time the blocking event was active. I am finding it a little hard in PgSQL to find this information.
>
> I am seeking help in finding a detailed analysis on the locks that
> happened yesterday,
> 2 days back or in the last week. Can someone assist please.
PostgreSQL doesn't keep historical information on these things.
You need a monitoring tool like pgwatch2 that takes regular snapshots of these data and allows you to access this information.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Finding detailed information about LOCKS
@ 2024-05-06 04:24 Siraj G <tosiraj.g@gmail.com>
parent: Wetmore, Matthew (CTR) <Matthew.Wetmore@evernorth.com>
0 siblings, 0 replies; 7+ messages in thread
From: Siraj G @ 2024-05-06 04:24 UTC (permalink / raw)
To: Wetmore, Matthew (CTR) <Matthew.Wetmore@evernorth.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Hello Team
Thank you for the responses.
There are a few environments that are GCP managed, in our landscape. Hence
I am also exploring the DB flags and if there are anything that I can set
up as a cron from the jumphost.
On Fri, May 3, 2024 at 7:34 PM Wetmore, Matthew (CTR) <
Matthew.Wetmore@evernorth.com> wrote:
> If you can't get pgwatch2
>
> Cron job that runs every hour:
>
> grep -E "lock" (or whatever search term) postgresql.log > lock_history.txt
>
> Or something to that effect, not as good as the tool obviously, but a
> workingperson's solution.
>
> -----Original Message-----
> From: Laurenz Albe <laurenz.albe@cybertec.at>
> Sent: Thursday, May 2, 2024 11:16 PM
> To: Siraj G <tosiraj.g@gmail.com>; Pgsql-admin <
> pgsql-admin@lists.postgresql.org>
> Subject: [EXTERNAL] Re: Finding detailed information about LOCKS
>
> On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> > I come from Oracle background. In Oracle there is a licensed feature
> > (Diagnostics + Tuning) upon using which the system keeps historic
> > session records, which gives a better way to find out locking related
> > details- like the blocking session, total sessions blocked and the
> > time the blocking event was active. I am finding it a little hard in
> PgSQL to find this information.
> >
> > I am seeking help in finding a detailed analysis on the locks that
> > happened yesterday,
> > 2 days back or in the last week. Can someone assist please.
>
> PostgreSQL doesn't keep historical information on these things.
>
> You need a monitoring tool like pgwatch2 that takes regular snapshots of
> these data and allows you to access this information.
>
> Yours,
> Laurenz Albe
>
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2024-05-06 04:24 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-05-03 05:24 Finding detailed information about LOCKS Siraj G <tosiraj.g@gmail.com>
2024-05-03 06:16 ` Laurenz Albe <laurenz.albe@cybertec.at>
2024-05-03 06:22 ` Wasim Devale <wasimd60@gmail.com>
2024-05-03 06:26 ` Laurenz Albe <laurenz.albe@cybertec.at>
2024-05-03 06:30 ` Wasim Devale <wasimd60@gmail.com>
2024-05-03 14:03 ` Wetmore, Matthew (CTR) <Matthew.Wetmore@evernorth.com>
2024-05-06 04:24 ` Siraj G <tosiraj.g@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox