Re: what does pg_activity mean when the database is stuck?
От | Si Chen |
---|---|
Тема | Re: what does pg_activity mean when the database is stuck? |
Дата | |
Msg-id | CAAYSSjM1jnpagsvJW8oHMPzcaqUM8pho-X=P+eMjENTUEk5K+g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: what does pg_activity mean when the database is stuck? (Igor Neyman <ineyman@perceptron.com>) |
Ответы |
Re: what does pg_activity mean when the database is stuck?
|
Список | pgsql-general |
PgBouncer looks pretty cool. Do you recommend using it with jdbc with about 50 - 100 normal connections?
On Thu, Jun 12, 2014 at 6:35 AM, Igor Neyman <ineyman@perceptron.com> wrote:
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Si ChenSent: Wednesday, June 11, 2014 10:44 PMTo: pgsql-general@postgresql.org
Subject: Re: [GENERAL] what does pg_activity mean when the database is stuck?The best solution for this is to use some connection pooler, such as PgBouncer.Is there a way to configure postgresql to automatically release connections that have been idle for a set amount of time?
On Wed, Jun 11, 2014 at 3:41 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
On Wed, Jun 11, 2014 at 5:37 PM, Si Chen
<sichen@opensourcestrategies.com> wrote:
> The state is "idle". I don't have the state_change, but I will try to
> collect it if it happens again.
If they are idle, then the problem is probably with your application
-- you're grabbing new connections and not closing them or reusing
them. It's a very common problem. The 'query' when idle represents
the last query run -- the database finished it and is sitting around.
merlin
--
Si Chen
Open Source Strategies, Inc.
sichen@opensourcestrategies.com
http://www.OpenSourceStrategies.com
LinkedIn: http://www.linkedin.com/in/opentaps
Twitter: http://twitter.com/opentaps
B.t.w., PgBouncer can also disconnect idle client connections (if you really wish) based on configuration setting.
Regards,
Igor Neyman
Si Chen
Open Source Strategies, Inc.
sichen@opensourcestrategies.com
http://www.OpenSourceStrategies.com
LinkedIn: http://www.linkedin.com/in/opentaps
Twitter: http://twitter.com/opentaps
В списке pgsql-general по дате отправления: