pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Monitoring Active Connections
4+ messages / 3 participants
[nested] [flat]

* Monitoring Active Connections
@ 2016-02-05 17:24 rajan <vgmonnet@gmail.com>
  2016-02-05 17:43 ` Re: Monitoring Active Connections Keith <keith@keithf4.com>
  2016-02-05 17:47 ` Re: Monitoring Active Connections Fernando Hevia <fhevia@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: rajan @ 2016-02-05 17:24 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I have a scenario in which a deadlock occurred following an unusual increase
in Number of Active Connections to the database.

In an hour, the Active Connection shooted up to 250 from 1 and it came back
to normal by the end of the hour. At that time the deadlock occurred.
Deadlock information contains a relation id and two pids, both of them are
NOT traceable.

Now I want to analysed what would have caused an unsual number of increase
in the number of Active Connections, I can't get any data out of
pg_stat_activity. Now the total number of connections is 75 only. Will there
be any log from which I can get those queries or connection details?

Can anybody help me on this?



-----
--
Thanks,
Rajan.
--
View this message in context: http://postgresql.nabble.com/Monitoring-Active-Connections-tp5886073.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Monitoring Active Connections
  2016-02-05 17:24 Monitoring Active Connections rajan <vgmonnet@gmail.com>
@ 2016-02-05 17:43 ` Keith <keith@keithf4.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Keith @ 2016-02-05 17:43 UTC (permalink / raw)
  To: rajan <vgmonnet@gmail.com>; +Cc: pgsql-admin

Ensure you have "log_connections" and "log_disconnections" set to "on" in
your postgresql.conf. This will add the connection info to your postgres
logs. Keep in mind if you have a very high connection rate, this can cause
a very noticeable increase in your log size. If you did not have these
turned on before, there's nothing I'm aware of within the database itself
that tracks connections in the manner you're looking for. pg_stat_activity
only shows what is happening right at that moment when you query it.

On Fri, Feb 5, 2016 at 12:24 PM, rajan <vgmonnet@gmail.com> wrote:

> Hello,
>
> I have a scenario in which a deadlock occurred following an unusual
> increase
> in Number of Active Connections to the database.
>
> In an hour, the Active Connection shooted up to 250 from 1 and it came back
> to normal by the end of the hour. At that time the deadlock occurred.
> Deadlock information contains a relation id and two pids, both of them are
> NOT traceable.
>
> Now I want to analysed what would have caused an unsual number of increase
> in the number of Active Connections, I can't get any data out of
> pg_stat_activity. Now the total number of connections is 75 only. Will
> there
> be any log from which I can get those queries or connection details?
>
> Can anybody help me on this?
>
>
>
> -----
> --
> Thanks,
> Rajan.
> --
> View this message in context:
> http://postgresql.nabble.com/Monitoring-Active-Connections-tp5886073.html
> Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Monitoring Active Connections
  2016-02-05 17:24 Monitoring Active Connections rajan <vgmonnet@gmail.com>
@ 2016-02-05 17:47 ` Fernando Hevia <fhevia@gmail.com>
  2016-02-06 06:14   ` Re: Monitoring Active Connections rajan <vgmonnet@gmail.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Fernando Hevia @ 2016-02-05 17:47 UTC (permalink / raw)
  To: rajan <vgmonnet@gmail.com>; +Cc: pgsql-admin

On Fri, Feb 5, 2016 at 2:24 PM, rajan <vgmonnet@gmail.com> wrote:

> Hello,
>
> I have a scenario in which a deadlock occurred following an unusual
> increase
> in Number of Active Connections to the database.
>
> In an hour, the Active Connection shooted up to 250 from 1 and it came back
> to normal by the end of the hour. At that time the deadlock occurred.
> Deadlock information contains a relation id and two pids, both of them are
> NOT traceable.
>
>
My guess would be that the deadlock caused the spike in connections, not
the other way around.


> Now I want to analysed what would have caused an unsual number of increase
> in the number of Active Connections, I can't get any data out of
> pg_stat_activity. Now the total number of connections is 75 only. Will
> there
> be any log from which I can get those queries or connection details?
>
>
If you have log_connections enabled you will find client connections logged
in PostgreSQL's log file.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Monitoring Active Connections
  2016-02-05 17:24 Monitoring Active Connections rajan <vgmonnet@gmail.com>
  2016-02-05 17:47 ` Re: Monitoring Active Connections Fernando Hevia <fhevia@gmail.com>
@ 2016-02-06 06:14   ` rajan <vgmonnet@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: rajan @ 2016-02-06 06:14 UTC (permalink / raw)
  To: pgsql-admin

Thanks for the information...

Unfortunately I don't have the log_connections enabled. :(



-----
--
Thanks,
Rajan.
--
View this message in context: http://postgresql.nabble.com/Monitoring-Active-Connections-tp5886073p5886113.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-02-06 06:14 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-02-05 17:24 Monitoring Active Connections rajan <vgmonnet@gmail.com>
2016-02-05 17:43 ` Keith <keith@keithf4.com>
2016-02-05 17:47 ` Fernando Hevia <fhevia@gmail.com>
2016-02-06 06:14   ` rajan <vgmonnet@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