Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cntTh-0002aC-HN for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Mar 2017 20:55:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cntTg-0003f2-Aa for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Mar 2017 20:55:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cntTf-0003bt-3H for pgsql-bugs@postgresql.org; Tue, 14 Mar 2017 20:55:31 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cntTc-0007HR-3O for pgsql-bugs@postgresql.org; Tue, 14 Mar 2017 20:55:30 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DBA3C216AF; Tue, 14 Mar 2017 16:55:26 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Tue, 14 Mar 2017 16:55:26 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Us601oCnpNnD6G 78Q/6+oNnYQ08=; b=Zt0PjaGRdHQfN0egp2RjAmrCE6p9jlQbNX7UPgOfgcihBV d17COkbgHgAm0He20OoPcyrX/n0tgeqyYMNCTBk98iBa7/9aC/L59GPWuJAJ62Kk frOLcov4qWC1Qh8AmQi21e1l0spRNvF7w60hcWqwUy9JvsNQvXjejyRgtZIFo= X-ME-Sender: X-Sasl-enc: mpXjz/ZAdpAMo3kg3VjeOFyPbXs0g3vLm67IbsPEDdpP 1489524926 Received: from intern.anarazel.de (unknown [208.72.138.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 8FDC37E5A0; Tue, 14 Mar 2017 16:55:26 -0400 (EDT) Date: Tue, 14 Mar 2017 13:55:24 -0700 From: Andres Freund To: Andrzej Pilacik Cc: pgsql-bugs@postgresql.org Subject: Re: postgresql hanging/stuck Message-ID: <20170314205524.u24xthif5tk3t2ef@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) 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 Hi, On 2017-03-14 16:47:40 -0400, Andrzej Pilacik wrote: > Since then we had 2 incidents where PostgreSQL connections went to about > 300 and PostgreSQL became unresponsive and restarted itself. Could you give a bit more details about how that "retarted itself" happened? Any chance you saw something about a "stuck spinlock" in the logs? > We have monitors setup to page us when connections are over 250. > PostgreSQL should still have about 250 connections available. > > When this occurred, we saw a lot of connections in the authentication state > (stuck) > > *They all looked like: postgres: username databasename ipaddress (pid) > authentication* The symptoms suggest you're hitting quite massive lock contention. But that's just a guess, not yet enough information to nail that down. If that's the case, a update to 9.6 might resolve the issue, we've done two significant scalability improvements that could affect your case. > During the incident (about 10-15min timeline) > > - CPUs are running high but the box is still very responsible. 60-70% > > - Memory allocations are ok, no paging. Nothing looks out of norm. Have you checked that you're not running into issues with transparent hugepages? The symptoms don't quite match, but it's still useful to make sure. I don't know which kernel / distribution you're running, but a search for "disable transparent hugepages $distro" should help. > - We have our normal scenario engine running with about 30-40 active > connections + some 5-10 active reporting and processing connections at a > time (lots of quick/short queries) Is there a chance you could provide a profile using perf? See https://wiki.postgresql.org/wiki/Profiling_with_perf Greetings, Andres Freund -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs