Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YeKTP-0004ml-4d for pgsql-bugs@arkaria.postgresql.org; Sat, 04 Apr 2015 09:34:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YeKTO-0003mC-Jd for pgsql-bugs@arkaria.postgresql.org; Sat, 04 Apr 2015 09:34:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YeKTN-0003m5-B0 for pgsql-bugs@postgresql.org; Sat, 04 Apr 2015 09:34:37 +0000 Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YeKTD-0007eJ-OL for pgsql-bugs@postgresql.org; Sat, 04 Apr 2015 09:34:35 +0000 Received: by qcrf4 with SMTP id f4so89928162qcr.0 for ; Sat, 04 Apr 2015 02:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=L6GDaz7wbmKXSR5pte97m5j+xsurvBieL4/A8xy4sYk=; b=DIyfQpZt/N0LClShg8DOnM2jEJQsnaq8RvyDhxYSGytsW/vCoZIIydabtj1M+V8gex 1WBUYnNpcnjPb0R7YstCnwBGDLXp6MEfugB7XGdrBSOZ/Lw/GXZAWSJ8LuKrp1scbhYY hfTXWlYytimxPd0F5bUq0rbDHrg8mh2dR8oWvFxaSpURU/cMnOlIUEryTQzLDez6Qbwl RN0ijWBWvaddbFRj5MnUGUGgaFt4dTxx0vs591W6HGp9qBV/2exh3ee4o853Fj1QBLqI 90y4pLNhKwKLRJUMMymkzC+B2n/4nId4e6ymI3wUXPsbuv5iD/cunH+lMN9yrv7klTVh y49g== X-Received: by 10.140.32.202 with SMTP id h68mr6841608qgh.77.1428140066711; Sat, 04 Apr 2015 02:34:26 -0700 (PDT) Received: from [10.8.5.54] (167.126.158.98.client.static.strong-in25.as13926.net. [98.158.126.167]) by mx.google.com with ESMTPSA id h128sm7468349qhc.6.2015.04.04.02.34.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 04 Apr 2015 02:34:25 -0700 (PDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_B9A86BF3-AFD8-4A45-8115-F0A2B50BB705" Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: Postgresql 9.4.1 stuck all queries when making multi updates From: Ilya Bazylchuk In-Reply-To: Date: Sat, 4 Apr 2015 12:34:20 +0300 Cc: pgsql-bugs@postgresql.org Message-Id: References: <24169366-5D72-4363-8F60-529442AD39BF@gmail.com> To: Venkata Balaji N X-Mailer: Apple Mail (2.2070.6) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --Apple-Mail=_B9A86BF3-AFD8-4A45-8115-F0A2B50BB705 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 nothing in pgpool. Pgpool use only resque/sidekiq. Rest use unicorn = directly to master. 1. 45 connections 2. 45 connections 3. 30 connections 4. 10 connections When connections stucks, growth count connections from unicorn only. = Seems it not granted locks, but weird that i didn=E2=80=99t have it on = 9.3. In general didn=E2=80=99t change except new pg servers. I added log for not granted locks, and in 12 hours got only one, and it = was short and on another table, which never presented in pg logs. will = see more. lock_timeout: 30000 deadlock_timeout: 1s statement_timeout: 0 I know that set statement_timeout isn=E2=80=99t recommended, but = what=E2=80=99s better solution, don=E2=80=99t get stuck db? > 4 =D0=B0=D0=BF=D1=80. 2015 =D0=B3., =D0=B2 3:10, Venkata Balaji N = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >=20 >=20 > On Fri, Apr 3, 2015 at 10:14 PM, Ilya Bazylchuk = > wrote: > Before i used 9.3.5 and servers with ubuntu 12 with 32GB memory. >=20 > After upgrade to 9.4.1, with more power server 60GB memory on each in = wall replication and ubuntu 14, started get db stucks when run multi = update from resque/sidekiq background workers. resque/sidekiq work via = pgpool 3.3 >=20 > Do you see any messages in pgpool logs ? > =20 > Queries can be as simple, update column where primary id =3D id. and = complex, doesn't metter. usually average connections about less 300, but = when queries stucks, count connections grow to maximum and i get >=20 > LOG: process 16121 still waiting for ShareLock on transaction = 2448707428 after 1000.121 ms > DETAIL: Process holding the lock: 16139. Wait queue: 16121. > LOG: process 16146 still waiting for ExclusiveLock on tuple = (665346,11) of relation 997395 of database 16455 after 1000.102 ms > DETAIL: Process holding the lock: 16121. Wait queue: 16146. > ERROR: canceling statement due to lock timeout >=20 > Any idea, how long the locks were hanging in there for ? > Do you have any SQL timeouts configured in postgresql.conf ? > =20 > then >=20 > FATAL: sorry, too many clients already > then only restart help, when run restart got this >=20 > WARNING: terminating connection because of crash of another server = process > DETAIL: The postmaster has commanded this server process to roll back = the current transaction and exit, because another server process exited = abnormally and possibly corrupted shared memory. > HINT: In a moment you should be able to reconnect to the database and = repeat your command. >=20 > This precisely means, one of the connections got crashed/killed. >=20 > Regards, > Venkata Balaji N >=20 > Fujitsu Australia --Apple-Mail=_B9A86BF3-AFD8-4A45-8115-F0A2B50BB705 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
nothing in pgpool. Pgpool use only = resque/sidekiq. Rest use unicorn directly to master.
1. 45 connections
2. 45 = connections
3. 30 connections
4.= 10 connections

When connections stucks, growth count connections from = unicorn only. Seems it not granted locks, but weird that i didn=E2=80=99t = have it on 9.3.

In general didn=E2=80=99t change except new pg = servers.

I = added log for not granted locks, and in 12 hours got only one, and it = was short and on another table, which never presented in pg logs. will = see more.

lock_timeout: 30000
deadlock_timeout: = 1s
statement_timeout: = 0

I know that = set statement_timeout isn=E2=80=99t recommended,= but what=E2=80=99s better solution, don=E2=80=99t get stuck = db?


4 =D0=B0=D0=BF=D1=80. 2015 =D0=B3., =D0=B2 = 3:10, Venkata Balaji N <nag1010@gmail.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0= =BB(=D0=B0):


On Fri, Apr 3, 2015 at 10:14 PM, = Ilya Bazylchuk <ilya.bazylchuk@gmail.com> wrote:

Before i used 9.3.5 and servers with ubuntu 12 with 32GB = memory.

After upgrade to 9.4.1, with more power server 60GB memory = on each in wall replication and ubuntu 14, started get db stucks when = run multi update from resque/sidekiq background workers. resque/sidekiq = work via pgpool 3.3

Do you = see any messages in pgpool logs ?
 

Queries can be as simple, update column where primary id =3D= id. and complex, doesn't metter. usually average connections about less = 300, but when queries stucks, count connections grow to maximum and i = get

LOG:  process 16121 still waiting for =
ShareLock on transaction 2448707428 after 1000.121 ms
DETAIL:  Process holding the lock: 16139. Wait queue: 16121.
LOG:  process 16146 still waiting for ExclusiveLock on tuple (665346,11) =
of relation 997395 of database 16455 after 1000.102 ms
DETAIL:  Process holding the lock: 16121. Wait queue: 16146.
ERROR:  canceling statement due to lock timeout

Any idea, how long the locks were hanging in there for = ?
Do you have any SQL timeouts configured in = postgresql.conf ?
 

then

FATAL:  sorry, too many clients =
already

then only restart help, when run restart got this

WARNING:  terminating connection =
because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back =
the current transaction and exit, because another server process exited =
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and =
repeat your command.

This precisely means, one of the connections got = crashed/killed.

Regards,
Venkata = Balaji N

Fujitsu= Australia

= --Apple-Mail=_B9A86BF3-AFD8-4A45-8115-F0A2B50BB705--