Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTh5S-0001WH-UT for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2015 01:29:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTh5R-00038V-Hz for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2015 01:29:57 +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 1YTh5O-000386-Vt for pgsql-performance@postgresql.org; Fri, 06 Mar 2015 01:29:55 +0000 Received: from mail-bn1bon0610.outbound.protection.outlook.com ([2a01:111:f400:fc10::1:610] helo=na01-bn1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTh5D-00035O-9p for pgsql-performance@postgresql.org; Fri, 06 Mar 2015 01:29:52 +0000 Received: from decina.local (24.55.12.91) by BN3PR11MB0338.namprd11.prod.outlook.com (25.161.220.20) with Microsoft SMTP Server (TLS) id 15.1.106.15; Fri, 6 Mar 2015 01:29:35 +0000 Message-ID: <54F902F6.6040608@BlueTreble.com> Date: Thu, 5 Mar 2015 19:29:26 -0600 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Soni M , "pgsql-performance@postgresql.org" Subject: Re: slow server : s_lock and _bt_checkkeys on perf top References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [24.55.12.91] X-ClientProxiedBy: BY2PR06CA058.namprd06.prod.outlook.com (10.141.250.176) To BN3PR11MB0338.namprd11.prod.outlook.com (25.161.220.20) Authentication-Results: postgresql.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR11MB0338; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(24454002)(51704005)(53754006)(479174004)(377454003)(2501003)(92566002)(87976001)(2950100001)(47776003)(62966003)(36756003)(77156002)(65806001)(40100003)(66066001)(122386002)(15975445007)(83506001)(23676002)(19580395003)(50986999)(42186005)(80316001)(50466002)(107886001)(59896002)(33656002)(76176999)(54356999)(86362001)(65816999)(87266999)(46102003)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR11MB0338; H:decina.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002007); SRVR:BN3PR11MB0338; BCL:0; PCL:0; RULEID:; SRVR:BN3PR11MB0338; X-Forefront-PRVS: 05079D8470 X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2015 01:29:35.7657 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR11MB0338 X-Pg-Spam-Score: -1.9 (-) 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 On 3/4/15 1:31 PM, Soni M wrote: > Hello All, > > Master db size 1.5 TB > All postgres 9.1.13 installed from RHEL package. > It has streaming replica and slony replica to another servers. > > Server performance is slower than usual, before that, there's a big > query got cancelled and then performance get slow. > > No sign of IO wait. > > on sar, it's %user and %system dominate the cpu usage > 01:25:04 PM CPU %user %nice %system %iowait %steal > %idle > Average: all 51.91 0.00 12.03 0.66 0.00 > 35.39 > > on perf top, i saw > 18.93% postgres [.] s_lock > 10.72% postgres [.] _bt_checkkeys > almost always at top. _bt_checkkeys is the function that compares a row in a btree index to a condition. s_lock is a spinlock; the high CPU usage in there indicates there's heavy lock contention somewhere. Is there one PG process that's clearly using more CPU than the others? What else is running in the database? Are there any unusual data types involved? -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance