Re: Connection hike

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Connection hike
Дата
Msg-id c23283b7aaa8deb64dc1afddfe509ca79e1dfe5e.camel@cybertec.at
обсуждение исходный текст
Ответ на Connection hike  (Rajesh Kumar <rajeshkumar.dba09@gmail.com>)
Ответы Re: Connection hike
Список pgsql-admin
On Wed, 2024-03-13 at 18:14 +0530, Rajesh Kumar wrote:
> There were connections hike and I used to check blocking sessions and long
> running queries using pg_stat_activity.
>
> My manager gave me less rating during performance meeting, because he says
> even a kid can do this. He said my job is to analyse the cause of connection hike. 
>
> Any idea how to analyse?

I assume that you mean "hang", not "hike".

You can diagnose locked sessions fron the "wait_event" and "wait_event_type" in
"pg_stat_activity".  For the process ID of a blocked session, you can call the
"pg_blocking_pids()" function to get the process IDs of the sessions blocking it.

You can look at "pg_locks" to see on which object the lock is (a lock waiting
for a transaction is waiting for a row lock).

That's about all you can analyze in the database.  To figure out which statements
took the locks that block others, you'd have to debug the application.

Yours,
Laurenz Albe



В списке pgsql-admin по дате отправления:

Предыдущее
От: Rajesh Kumar
Дата:
Сообщение: Connection hike
Следующее
От: Rajesh Kumar
Дата:
Сообщение: Re: Connection hike