Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YdzYs-0003xC-7j for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Apr 2015 11:14:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YdzYq-0005nl-N6 for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Apr 2015 11:14:52 +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 1YdzYp-0005ne-Ad for pgsql-bugs@postgresql.org; Fri, 03 Apr 2015 11:14:51 +0000 Received: from mail-qc0-x234.google.com ([2607:f8b0:400d:c01::234]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YdzYh-0008KI-V9 for pgsql-bugs@postgresql.org; Fri, 03 Apr 2015 11:14:49 +0000 Received: by qcgx3 with SMTP id x3so87242994qcg.3 for ; Fri, 03 Apr 2015 04:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:subject:message-id:date:to:mime-version; bh=lgcdUfpv2mPmA56uWQeCV2hvXItfra/j84VCrTPQZgg=; b=okqUl4HaM3JXXHapEr5P7z3eEJQBLFfyzbnpNWnn3FjabmhGVOaFnz0pyvQpNuYx7F eoJLOszNpLbEstWjrD0LCG7vwsNIkJMCYAbD70VKw9WZQGHKC35QWVKjVamhq93aRKEO TubloIUynDwOvV+QRJ3cbLda3BuJDRGS5yX0d6ZR6bow+jJw2rdzS/L6TcPXuvX1LH/p yGKKMAemcbr6ylyUBZ4+wpMsVWxAy/DWmQ8t0dhq71g5nQqO7iW5D6rnriy7B3826N7N tZLLb2ogEpPCNdjgjVzXlWndEWkpiZULiNCJhojdrxBau00T/tvxKhOAACX9OTK++Zio sE2Q== X-Received: by 10.55.20.87 with SMTP id e84mr3262085qkh.43.1428059682831; Fri, 03 Apr 2015 04:14:42 -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 k51sm5461174qge.6.2015.04.03.04.14.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Apr 2015 04:14:41 -0700 (PDT) From: Ilya Bazylchuk Content-Type: multipart/alternative; boundary="Apple-Mail=_E20E8984-62B5-4138-A0D7-C628D02429F7" Subject: Postgresql 9.4.1 stuck all queries when making multi updates Message-Id: <24169366-5D72-4363-8F60-529442AD39BF@gmail.com> Date: Fri, 3 Apr 2015 14:14:37 +0300 To: pgsql-bugs@postgresql.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) 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=_E20E8984-62B5-4138-A0D7-C628D02429F7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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 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 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. Current settings, Database size 190GB max_connections =3D 400 shared_buffers =3D 13GB work_mem =3D 19660kB maintenance_work_mem =3D 2GB effective_cache_size =3D 40GB But i played with different, didn't help. On 9.3 all was fine. Nothing = more in logs. Also in one day i did pg_repack, on next day db was down with usual = queries.= --Apple-Mail=_E20E8984-62B5-4138-A0D7-C628D02429F7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

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

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

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.

Current = settings,

Database =
size 190GB
max_connections =3D 400
shared_buffers =3D 13GB
work_mem =3D 19660kB
maintenance_work_mem =3D 2GB
effective_cache_size =3D 40GB

But i played with = different, didn't help. On 9.3 all was fine. Nothing more in logs.

Also in one day i did = pg_repack, on next day db was down with usual = queries.

= --Apple-Mail=_E20E8984-62B5-4138-A0D7-C628D02429F7--