Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XC2f5-0001bf-ER for pgsql-performance@arkaria.postgresql.org; Tue, 29 Jul 2014 08:21:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XC2f4-0006CJ-DH for pgsql-performance@arkaria.postgresql.org; Tue, 29 Jul 2014 08:21:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XC2f2-0006C4-9Z for pgsql-performance@postgresql.org; Tue, 29 Jul 2014 08:21:28 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XC2ey-0006ue-7A for pgsql-performance@postgresql.org; Tue, 29 Jul 2014 08:21:26 +0000 Received: by mail-pa0-f49.google.com with SMTP id hz1so11973542pad.36 for ; Tue, 29 Jul 2014 01:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=YAJHBRkhkVwC3AZ+aPSn26AUJkWHHMUZWXVZsKxd76o=; b=t7oFftAhX0Qm196BAazbJH7BMphFtkxgtb89V/drhjcQ6yc/d6RsjA79DddCZuY7fA KOR/qA5hJUOdG4GhtTiukP/o8yBqgmhJRRs2JcLSwOAjbsIddvJwrqq6MYFnt3alir+1 0umraFIaeFv2ePnsy3Jgl9H0h8YQBwoh9Xjwmd7d7dyev2TipVQMGGYjv8B42TjGbAmn poF8EPVydbmtno7BoTvCum1Nk3TntMUE+gywYYHvRJERNoxTwY2C2UZ60N3HIZ2BzoCV UtP8Y8ygDpDcM6WyyLMZaMDUuHPDZHOiwHMVTRjiQzDE/K7kmMeiJQUp3QVBw+duO1rd 3drg== X-Received: by 10.68.213.74 with SMTP id nq10mr575085pbc.4.1406622081095; Tue, 29 Jul 2014 01:21:21 -0700 (PDT) Received: from [192.168.2.106] ([116.226.74.154]) by mx.google.com with ESMTPSA id o16sm17105325pby.78.2014.07.29.01.21.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jul 2014 01:21:20 -0700 (PDT) From: Rural Hunter X-Google-Original-From: Rural Hunter Message-ID: <53D7597E.2080209@gmail.com> Date: Tue, 29 Jul 2014 16:21:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" Subject: Re: Very slow planning performance on partition table References: <53CFB6BC.4050606@gmail.com> <25010.1406253203@sss.pgh.pa.us> <53D26875.2080604@gmail.com> <53D51E49.102@gmail.com> <24564.1406478487@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org More information found. After the hang connection appears, I noticed there were several hundreds of connections of the same user. Since I use pgbouncer and I only set the pool size to 50 for each user, this is very strange. I checked the pgbouncer side, 'show pools' showed the active server connection count is less than 50(only 35 actually). I also checked the client port which is shown in pg process list. It is not used at pgbouncer side when I did the check. So I stopped pgbouncer then the connection count from the user drops slowly. Finally all those connections disappeared. After that I restarted pgbouncer and it looks good again. With this solution, I at least don't have to kill pg when the problem happens. But anyone has a clue why this happens? What I need to check for the root cause? One thing I forgot to check is the network status of those orphan connections at pg side. I will check it next time and see if they are in abnormal status. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance